v0.3.4: added a couple null safety checks

This commit is contained in:
Evan Debenham 2016-02-09 23:05:06 -05:00 committed by Evan Debenham
parent 8c8e96561b
commit 5d7df4abd4

View File

@ -615,9 +615,13 @@ public class GameScene extends PixelScene {
} }
public static Ripple ripple( int pos ) { public static Ripple ripple( int pos ) {
Ripple ripple = (Ripple)scene.ripples.recycle( Ripple.class ); if (scene != null) {
ripple.reset( pos ); Ripple ripple = (Ripple) scene.ripples.recycle(Ripple.class);
ripple.reset(pos);
return ripple; return ripple;
} else {
return null;
}
} }
public static SpellSprite spellSprite() { public static SpellSprite spellSprite() {