Skip to content

Commit

Permalink
Prevent Null pointer when setting opacity on an image.
Browse files Browse the repository at this point in the history
  • Loading branch information
nightm4re94 committed Mar 30, 2020
1 parent 00178dd commit 2c55195
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/de/gurkenlabs/litiengine/util/Imaging.java
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,8 @@ public static BufferedImage scale(final BufferedImage image, final int width, fi
}

public static BufferedImage setOpacity(final Image img, final float opacity) {
if (img == null)
return null;
final BufferedImage bimage = getCompatibleImage(img.getWidth(null), img.getHeight(null));
if (bimage == null) {
return null;
Expand Down

0 comments on commit 2c55195

Please sign in to comment.