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.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gui/windows/maileditwindow.cpp b/src/gui/windows/maileditwindow.cpp
index 12ab097c0..1699b979c 100644
--- a/src/gui/windows/maileditwindow.cpp
+++ b/src/gui/windows/maileditwindow.cpp
@@ -136,11 +136,14 @@ void MailEditWindow::action(const ActionEvent &event)
if (tempItem)
{
const Inventory *const inv = PlayerInfo::getInventory();
- const Item *const item = inv->findItem(tempItem->getId(), 1);
- if (item)
+ if (inv)
{
- mailHandler->setAttach(item->getInvIndex(),
- tempItem->getQuantity());
+ const Item *const item = inv->findItem(tempItem->getId(), 1);
+ if (item)
+ {
+ mailHandler->setAttach(item->getInvIndex(),
+ tempItem->getQuantity());
+ }
}
}