From e0d14cf8d3c809a0a5291823d3a962a4835a8f6e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 9 Aug 2015 00:25:50 +0300 Subject: Add some missing checks to gui found by paranucker. --- src/gui/widgets/itemcontainer.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/gui/widgets/itemcontainer.cpp') diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp index 9cfa0345d..e728cb3a4 100644 --- a/src/gui/widgets/itemcontainer.cpp +++ b/src/gui/widgets/itemcontainer.cpp @@ -71,7 +71,7 @@ namespace bool operator() (const ItemIdPair *const pair1, const ItemIdPair *const pair2) const { - if (!pair1 || !pair2) + if (!pair1->mItem || !pair2->mItem) return false; return (pair1->mItem->getInfo().getName() @@ -85,7 +85,7 @@ namespace bool operator() (const ItemIdPair *const pair1, const ItemIdPair *const pair2) const { - if (!pair1 || !pair2) + if (!pair1->mItem || !pair2->mItem) return false; return pair1->mItem->getId() < pair2->mItem->getId(); @@ -98,7 +98,7 @@ namespace bool operator() (const ItemIdPair *const pair1, const ItemIdPair *const pair2) const { - if (!pair1 || !pair2) + if (!pair1->mItem || !pair2->mItem) return false; const int w1 = pair1->mItem->getInfo().getWeight(); @@ -118,7 +118,7 @@ namespace bool operator() (const ItemIdPair *const pair1, const ItemIdPair *const pair2) const { - if (!pair1 || !pair2) + if (!pair1->mItem || !pair2->mItem) return false; const int c1 = pair1->mItem->getQuantity(); @@ -138,7 +138,7 @@ namespace bool operator() (const ItemIdPair *const pair1, const ItemIdPair *const pair2) const { - if (!pair1 || !pair2) + if (!pair1->mItem || !pair2->mItem) return false; const ItemInfo &info1 = pair1->mItem->getInfo(); @@ -490,7 +490,7 @@ void ItemContainer::mouseDragged(MouseEvent &event A_UNUSED) void ItemContainer::mouseReleased(MouseEvent &event) { - if (mClicks == 2) + if (mClicks == 2 || !inventoryHandler || !tradeHandler) return; switch (mSelectionStatus) -- cgit v1.2.3-70-g09d2