Skip to content

Commit

Permalink
Merged PR #2 into main
Browse files Browse the repository at this point in the history
  • Loading branch information
giroletm committed Apr 13, 2024
2 parents 8975d0f + 560bffe commit 0979fc0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ABStudio/Forms/SpritesheetEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,12 @@ private void LoadBitmap(string path=null)

private void RefreshZoom()
{
// On some computers, this method may be called by `InitializeComponent` in the class constructor.
// In this case, `spritesheet` is null, which can cause NullReferenceException to be thrown.
// See https://github.com/giroletm/ABStudio/pull/2
if (spritesheet == null)
return;

float w = spritesheet.Width * zoom;
float h = spritesheet.Height * zoom;

Expand Down

0 comments on commit 0979fc0

Please sign in to comment.