Merge pull request #8331 from Mailaender/replay-utility-nre

Added more useful exceptions to the command line utility replay parser
This commit is contained in:
Pavel Penev
2015-06-01 20:04:11 +03:00

View File

@@ -9,6 +9,7 @@
#endregion
using System;
using System.IO;
using OpenRA.FileFormats;
namespace OpenRA.Mods.Common.UtilityCommands
@@ -21,6 +22,9 @@ namespace OpenRA.Mods.Common.UtilityCommands
public void Run(ModData modData, string[] args)
{
var replay = ReplayMetadata.Read(args[1]);
if (replay == null)
throw new InvalidDataException("Failed to read replay meta data");
var info = replay.GameInfo;
var lines = FieldSaver.Save(info).ToLines(replay.FilePath);