From ff10b54405fe8980a022e98cd79d912c1f0ac353 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 21 Feb 2016 02:12:14 +0300 Subject: Add missing checks. --- src/gui/widgets/selldialog.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/gui/widgets/selldialog.cpp') 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) { -- cgit v1.2.3-70-g09d2