Skip to content

Commit

Permalink
Merge pull request #830 from VladiStep/fixSpriteInstanceCrash
Browse files Browse the repository at this point in the history
Fix of the room editor crash.
  • Loading branch information
Grossley committed Apr 11, 2022
2 parents dc006f0 + 80ebe49 commit ef1f1c7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions UndertaleModTool/Converters/UndertaleCachedImageLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,9 @@ public object Convert(object[] values, Type targetType, object parameter, Cultur
return null;

IList<UndertaleSprite.TextureEntry> textures = values[0] as IList<UndertaleSprite.TextureEntry>;
if (textures is null)
return null;

int index = (int)(float)values[1];
if (index > textures.Count - 1 || index < 0)
return null;
Expand Down

0 comments on commit ef1f1c7

Please sign in to comment.