Fix a crash in CheckSequences when the sprite image is null

This commit is contained in:
abcdefg30
2017-06-06 23:26:42 +02:00
committed by reaperrr
parent da5c70184e
commit 839945cf57

View File

@@ -82,7 +82,13 @@ namespace OpenRA.Mods.Common.Lint
{ {
foreach (var imageOverride in LintExts.GetFieldValues(traitInfo, imageField, emitError)) 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)); emitError("Custom sprite image {0} from actor {1} has no sequence definition.".F(imageOverride, actorInfo.Value.Name));
else else
CheckDefintions(imageOverride, sequenceReference, actorInfo, sequence, faction, field, traitInfo); CheckDefintions(imageOverride, sequenceReference, actorInfo, sequence, faction, field, traitInfo);