diff --git a/Portraiture/TextureLoader.cs b/Portraiture/TextureLoader.cs index a1eb39db..51fa74b7 100644 --- a/Portraiture/TextureLoader.cs +++ b/Portraiture/TextureLoader.cs @@ -222,8 +222,11 @@ private static void loadAllPortraits() ScaledTexture2D scaled; - - scaled = ScaledTexture2D.FromTexture(Game1.getCharacterFromName(name).Portrait, texture, scale); + + var npc = Game1.getCharacterFromName(name); + if (npc == null) + continue; + scaled = ScaledTexture2D.FromTexture(npc.Portrait, texture, scale); if (!pTextures.ContainsKey(folderName + ">" + name)) pTextures.Add(folderName + ">" + name, scaled); @@ -379,4 +382,4 @@ public class SmapiManifest public List Dependencies { get; set; } = new List(); } -} \ No newline at end of file +}