From 839945cf572a12797d8cd60ad86c52210009138f Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Tue, 6 Jun 2017 23:26:42 +0200 Subject: [PATCH] Fix a crash in CheckSequences when the sprite image is null --- OpenRA.Mods.Common/Lint/CheckSequences.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Lint/CheckSequences.cs b/OpenRA.Mods.Common/Lint/CheckSequences.cs index dd4e10e50a..a557f949a1 100644 --- a/OpenRA.Mods.Common/Lint/CheckSequences.cs +++ b/OpenRA.Mods.Common/Lint/CheckSequences.cs @@ -82,7 +82,13 @@ namespace OpenRA.Mods.Common.Lint { foreach (var imageOverride in LintExts.GetFieldValues(traitInfo, imageField, emitError)) { - if (!string.IsNullOrEmpty(imageOverride) && sequenceDefinitions.All(s => s.Key != imageOverride.ToLowerInvariant())) + if (string.IsNullOrEmpty(imageOverride)) + { + emitWarning("Custom sprite image of actor {0} is null.".F(actorInfo.Value.Name)); + continue; + } + + if (sequenceDefinitions.All(s => s.Key != imageOverride.ToLowerInvariant())) emitError("Custom sprite image {0} from actor {1} has no sequence definition.".F(imageOverride, actorInfo.Value.Name)); else CheckDefintions(imageOverride, sequenceReference, actorInfo, sequence, faction, field, traitInfo);