diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-02-21 02:12:14 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-02-21 02:53:45 +0300 |
commit | ff10b54405fe8980a022e98cd79d912c1f0ac353 (patch) | |
tree | 679a8096d1e30858760196c2a2ef95ddd6bcd58c /src/gui/widgets/selldialog.cpp | |
parent | 6c01b391c288622d8e360d823c9c1e35a874fa58 (diff) | |
download | plus-ff10b54405fe8980a022e98cd79d912c1f0ac353.tar.gz plus-ff10b54405fe8980a022e98cd79d912c1f0ac353.tar.bz2 plus-ff10b54405fe8980a022e98cd79d912c1f0ac353.tar.xz plus-ff10b54405fe8980a022e98cd79d912c1f0ac353.zip |
Add missing checks.
Diffstat (limited to 'src/gui/widgets/selldialog.cpp')
-rw-r--r-- | src/gui/widgets/selldialog.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gui/widgets/selldialog.cpp b/src/gui/widgets/selldialog.cpp index 189babc89..17664ed78 100644 --- a/src/gui/widgets/selldialog.cpp +++ b/src/gui/widgets/selldialog.cpp @@ -199,7 +199,8 @@ SellDialog::~SellDialog() void SellDialog::reset() { mShopItems->clear(); - mSlider->setValue(0); + if (mSlider) + mSlider->setValue(0); mShopItemList->setSelected(-1); updateButtonsAndLabels(); } @@ -256,8 +257,11 @@ void SellDialog::action(const ActionEvent &event) if (eventId == "slider") { - mAmountItems = CAST_S32(mSlider->getValue()); - updateButtonsAndLabels(); + if (mSlider) + { + mAmountItems = CAST_S32(mSlider->getValue()); + updateButtonsAndLabels(); + } } else if (eventId == "inc" && mSlider && mAmountItems < mMaxItems) { |