From 5d7df4abd49478d49bc614b50df07831b8ceac5c Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 9 Feb 2016 23:05:06 -0500 Subject: [PATCH] v0.3.4: added a couple null safety checks --- .../shatteredpixeldungeon/scenes/GameScene.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java b/src/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java index e659f67bb..843f97aa5 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java @@ -615,9 +615,13 @@ public class GameScene extends PixelScene { } public static Ripple ripple( int pos ) { - Ripple ripple = (Ripple)scene.ripples.recycle( Ripple.class ); - ripple.reset( pos ); - return ripple; + if (scene != null) { + Ripple ripple = (Ripple) scene.ripples.recycle(Ripple.class); + ripple.reset(pos); + return ripple; + } else { + return null; + } } public static SpellSprite spellSprite() {