From 475d78cd0599a1d39c4708a91fbb30c95b3f3418 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sun, 10 Jul 2016 23:20:01 -0400 Subject: [PATCH] v0.4.1: made tutorial badge code less error-prone --- .../shatteredpixeldungeon/Badges.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/Badges.java b/src/com/shatteredpixel/shatteredpixeldungeon/Badges.java index ebed59e22..8b6bd3cc0 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/Badges.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/Badges.java @@ -815,16 +815,16 @@ public class Badges { case MAGE: badge = Badge.TUTORIAL_MAGE; break; - case ROGUE: - break; - case HUNTRESS: + default: break; } - local.add( badge ); - if (!global.contains( badge )) { - global.add( badge ); - saveNeeded = true; + if (badge != null) { + local.add(badge); + if (!global.contains(badge)) { + global.add(badge); + saveNeeded = true; + } } }