From 274e756cce197de5ea445cfbbd9541dac7dd57f3 Mon Sep 17 00:00:00 2001 From: Collin Smith Date: Fri, 3 May 2019 17:54:24 -0700 Subject: [PATCH] Bugfix for NPE thrown by layers -- creating issue #51 --- core/src/com/riiablo/codec/Animation.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/com/riiablo/codec/Animation.java b/core/src/com/riiablo/codec/Animation.java index 7bb3404a..b98a1d37 100644 --- a/core/src/com/riiablo/codec/Animation.java +++ b/core/src/com/riiablo/codec/Animation.java @@ -236,7 +236,7 @@ public class Animation extends BaseDrawable { for (int l = 0; l < cof.getNumLayers(); l++) { COF.Layer cofLayer = cof.getLayer(l); Layer layer = layers[cofLayer.component]; - if (layer.blendMode == BlendMode.ID) { + if (layer != null && layer.blendMode == BlendMode.ID) { // FIXME: may be unnecessary in production layer.setBlendMode(BlendMode.BRIGHTEN, Riiablo.colors.highlight); } } @@ -254,7 +254,7 @@ public class Animation extends BaseDrawable { for (int l = 0; l < cof.getNumLayers(); l++) { COF.Layer cofLayer = cof.getLayer(l); Layer layer = layers[cofLayer.component]; - if (layer.blendMode == BlendMode.BRIGHTEN) { + if (layer != null && layer.blendMode == BlendMode.BRIGHTEN) { // FIXME: may be unnecessary in production layer.setBlendMode(BlendMode.ID); } }