diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bags/Bag.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bags/Bag.java index 2714dd87d..56818db7f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bags/Bag.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bags/Bag.java @@ -92,8 +92,8 @@ public class Bag extends Item implements Iterable { } public void grabItems(){ - if (this != Dungeon.hero.belongings.backpack) { - grabItems(Dungeon.hero.belongings.backpack); + if (owner != null && owner instanceof Hero && this != ((Hero) owner).belongings.backpack) { + grabItems(((Hero) owner).belongings.backpack); } }