summaryrefslogtreecommitdiff
path: root/src/gui/widgets/itemcontainer.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-08-09 00:25:50 +0300
committerAndrei Karas <akaras@inbox.ru>2015-08-09 00:25:50 +0300
commite0d14cf8d3c809a0a5291823d3a962a4835a8f6e (patch)
tree0b0720d0988e2468abc75cf68b654673f7f60a92 /src/gui/widgets/itemcontainer.cpp
parent12d4d6b33e036f17a0c59fa5a0c7af2c5d0461bc (diff)
downloadmanaverse-e0d14cf8d3c809a0a5291823d3a962a4835a8f6e.tar.gz
manaverse-e0d14cf8d3c809a0a5291823d3a962a4835a8f6e.tar.bz2
manaverse-e0d14cf8d3c809a0a5291823d3a962a4835a8f6e.tar.xz
manaverse-e0d14cf8d3c809a0a5291823d3a962a4835a8f6e.zip
Add some missing checks to gui found by paranucker.
Diffstat (limited to 'src/gui/widgets/itemcontainer.cpp')
-rw-r--r--src/gui/widgets/itemcontainer.cpp12
1 files changed, 6 insertions, 6 deletions
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)