From 9d521a19be347703bfdbb7802d0397a59c3edd7a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 24 Jun 2015 14:55:44 +0300 Subject: Add missing checks in windows. --- src/gui/windows/inventorywindow.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/gui/windows/inventorywindow.cpp') diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp index 4c11f1603..a57565d7f 100644 --- a/src/gui/windows/inventorywindow.cpp +++ b/src/gui/windows/inventorywindow.cpp @@ -182,6 +182,12 @@ InventoryWindow::InventoryWindow(Inventory *const inventory) : for (size_t f = 0; f < sz; f ++) mFilter->addButton(tags[f], tags[f], false); + if (!mInventory) + { + invInstances.push_back(this); + return; + } + switch (mInventory->getType()) { case InventoryType::INVENTORY: -- cgit v1.2.3-60-g2f50