diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndTradeItem.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndTradeItem.java index 6fadab609..d8bf0fdbb 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndTradeItem.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndTradeItem.java @@ -259,13 +259,13 @@ public class WndTradeItem extends Window { private void buy( Heap heap ) { - Hero hero = Dungeon.hero; Item item = heap.pickUp(); + if (item == null) return; int price = price( item ); Dungeon.gold -= price; - if (!item.doPickUp( hero )) { + if (!item.doPickUp( Dungeon.hero )) { Dungeon.level.drop( item, heap.pos ).sprite.drop(); } }