summaryrefslogtreecommitdiff
path: root/src/gui/windows/buyselldialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/windows/buyselldialog.cpp')
-rw-r--r--src/gui/windows/buyselldialog.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/windows/buyselldialog.cpp b/src/gui/windows/buyselldialog.cpp
index 6969b8fc0..0914dc43e 100644
--- a/src/gui/windows/buyselldialog.cpp
+++ b/src/gui/windows/buyselldialog.cpp
@@ -133,7 +133,10 @@ void BuySellDialog::action(const ActionEvent &event)
if (mNpcId != BeingId_negOne)
{
const Being *const being = actorManager->findBeing(mNpcId);
- npcHandler->buy(being);
+ if (being)
+ npcHandler->buy(being);
+ else
+ npcHandler->buy(mNpcId);
}
else
{