fix error propagating NPC sprites if they're not initialised yet

This commit is contained in:
Jesse Plamondon-Willard 2019-01-30 16:33:11 -05:00
parent 1556a04a54
commit 7a0ef80867
No known key found for this signature in database
GPG Key ID: 7D7C8097B62033CE
1 changed files with 1 additions and 1 deletions

View File

@ -529,7 +529,7 @@ namespace StardewModdingAPI.Metadata
{
// get NPCs
NPC[] characters = this.GetCharacters()
.Where(npc => this.GetNormalisedPath(npc.Sprite.textureName.Value) == key)
.Where(npc => npc.Sprite != null && this.GetNormalisedPath(npc.Sprite.textureName.Value) == key)
.ToArray();
if (!characters.Any())
return false;