Skip to content

Commit

Permalink
Fix a potential exception.
Browse files Browse the repository at this point in the history
  • Loading branch information
steffen-wilke committed Jan 3, 2019
1 parent 69e941c commit 8e26b91
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/de/gurkenlabs/litiengine/graphics/Spritesheet.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ public BufferedImage getSprite(final int index) {
}

public BufferedImage getSprite(final int index, final int margin, final int spacing) {
if (this.emptySprites.contains(index)) {
if (this.emptySprites.contains(index) || this.sprites.length == 0) {
return null;
}

if (this.sprites[index] != null) {
return this.sprites[index];
}
Expand Down

0 comments on commit 8e26b91

Please sign in to comment.