From 9cf86c5f9384d615ebfd31d17c2366de742518b0 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 30 Aug 2014 02:26:21 -0400 Subject: [PATCH] V0.2.0: fixed a nullpointer bug --- .../shatteredpixeldungeon/items/artifacts/Artifact.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java index 85e86adb2..45c9851cb 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java @@ -50,8 +50,8 @@ public class Artifact extends KindofMisc { GLog.w("you can only wear 2 misc items at a time"); return false; - } else if (hero.belongings.misc1.getClass() == this.getClass() - || hero.belongings.misc2.getClass() == this.getClass()){ + } else if ((hero.belongings.misc1 != null && hero.belongings.misc1.getClass() == this.getClass()) + || (hero.belongings.misc2 != null && hero.belongings.misc2.getClass() == this.getClass())){ GLog.w("you cannot wear two of the same artifact"); return false;