From c716bc218738f56b537d1346bda83f4fa67e9e2b Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Tue, 4 Nov 2014 20:23:52 +0100 Subject: [PATCH] Minor Bugfix: Add missing super call, catch potential NullPointer. --- src/de/teamteamteam/spacescooter/entity/Player.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/de/teamteamteam/spacescooter/entity/Player.java b/src/de/teamteamteam/spacescooter/entity/Player.java index 16de7c9..c80ccbc 100644 --- a/src/de/teamteamteam/spacescooter/entity/Player.java +++ b/src/de/teamteamteam/spacescooter/entity/Player.java @@ -30,6 +30,7 @@ public class Player extends ShootingEntity implements KeyboardListener { } public void update() { + super.update(); if(this.canMove) { super.update(); int off = 3; @@ -62,8 +63,10 @@ public class Player extends ShootingEntity implements KeyboardListener { */ @Override public void remove() { - this.keyboard.removeListener(this); - this.keyboard = null; + if(this.keyboard != null) { + this.keyboard.removeListener(this); + this.keyboard = null; + } super.remove(); }