summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/inventorywindow.cpp3
-rw-r--r--src/gui/widgets/itemcontainer.cpp3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp
index d6377e4dd..f52151698 100644
--- a/src/gui/inventorywindow.cpp
+++ b/src/gui/inventorywindow.cpp
@@ -378,7 +378,8 @@ Item *InventoryWindow::getSelectedItem() const
void InventoryWindow::widgetHidden(const gcn::Event &event)
{
Window::widgetHidden(event);
- mItems->hidePopup();
+ if (mItems)
+ mItems->hidePopup();
}
void InventoryWindow::mouseClicked(gcn::MouseEvent &event)
diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp
index de8b3c277..9a17d81cd 100644
--- a/src/gui/widgets/itemcontainer.cpp
+++ b/src/gui/widgets/itemcontainer.cpp
@@ -329,7 +329,8 @@ void ItemContainer::distributeValueChangedEvent()
void ItemContainer::hidePopup()
{
- mItemPopup->setVisible(false);
+ if (mItemPopup)
+ mItemPopup->setVisible(false);
}
void ItemContainer::keyPressed(gcn::KeyEvent &event A_UNUSED)