Skip to content

Commit

Permalink
Small bug fix
Browse files Browse the repository at this point in the history
Additional check to avoid System.InvalidCastException
  • Loading branch information
THGSCST committed Aug 22, 2023
1 parent 79b991c commit a7f4fe1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Tools/SPRTYL2PNG/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,12 @@ private void UpdatePreviewPanel()
previewPanel.Children.Add(spriteImage[i]);
}

var tg = (TileSet)loadedGraphics;
if (tg.TileSetGroupInformation != null)
TileSet tg = null;

if(loadedGraphics is TileSet)
tg = (TileSet)loadedGraphics;

if (tg != null && tg.TileSetGroupInformation != null)
{
tileColumnDef.Width = new GridLength(250);
var spriteTileImage = new Image[tg.TileSetGroupInformation.Length];
Expand Down

0 comments on commit a7f4fe1

Please sign in to comment.