summaryrefslogtreecommitdiff
path: root/src/gui/windows/maileditwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/windows/maileditwindow.cpp')
-rw-r--r--src/gui/windows/maileditwindow.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/windows/maileditwindow.cpp b/src/gui/windows/maileditwindow.cpp
index 74b214eb2..12ab097c0 100644
--- a/src/gui/windows/maileditwindow.cpp
+++ b/src/gui/windows/maileditwindow.cpp
@@ -160,8 +160,11 @@ void MailEditWindow::action(const ActionEvent &event)
}
}
-void MailEditWindow::addItem(const Item *const item, const int amount)
+void MailEditWindow::addItem(const Item *const item,
+ const int amount)
{
+ if (!item)
+ return;
mInventory->addItem(item->getId(),
item->getType(),
amount,