From 93caf1f1eb55a8c24a3ec1e408e8d767ac7f2ea4 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 19 Oct 2016 19:58:10 -0400 Subject: [PATCH] v0.4.3a: fixed a couple null pointer exceptions --- .../shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java | 2 +- .../com/shatteredpixel/shatteredpixeldungeon/ui/Toast.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java index 2efd866ac..4f8457ea3 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java @@ -801,7 +801,7 @@ public class GameScene extends PixelScene { public static void ready() { selectCell( defaultCellListener ); QuickSlotButton.cancel(); - scene.toolbar.examining = false; + if (scene != null) scene.toolbar.examining = false; } public static void examineCell( Integer cell ) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Toast.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Toast.java index af149ba49..7825bcd5e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Toast.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Toast.java @@ -81,7 +81,8 @@ public class Toast extends Component { public synchronized void kill() { super.kill(); //need to also destroy the text so that memory is freed - text.destroy(); + if (text != null) + text.destroy(); } public void text( String txt ) {