summaryrefslogtreecommitdiff
path: root/src/gui/gui.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-07-20 14:40:19 +0300
committerAndrei Karas <akaras@inbox.ru>2015-07-20 14:40:19 +0300
commit08ee66582f53822254763d79ca511c24b136be0f (patch)
treef91f636abe752a8675a63c8f4e11e1ce561a123b /src/gui/gui.cpp
parent06cd12850078d502915aa86bbcd65fc1cd4ec712 (diff)
downloadmanaplus-08ee66582f53822254763d79ca511c24b136be0f.tar.gz
manaplus-08ee66582f53822254763d79ca511c24b136be0f.tar.bz2
manaplus-08ee66582f53822254763d79ca511c24b136be0f.tar.xz
manaplus-08ee66582f53822254763d79ca511c24b136be0f.zip
Add some missing checks.
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r--src/gui/gui.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index c4c69afa1..382cd42bf 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -909,7 +909,7 @@ void Gui::distributeMouseEvent(Widget *const source,
if (type == MouseEventType::RELEASED)
dragDrop.clear();
- if (event.isConsumed())
+ if (!widget || event.isConsumed())
break;
// If a non modal focused widget has been reach
@@ -1306,8 +1306,12 @@ void Gui::distributeKeyEvent(KeyEvent &event) const
// If a non modal focused widget has been reach
// and we have modal focus cancel the distribution.
- if (mFocusHandler->getModalFocused() && !widget->isModalFocused())
+ if (widget &&
+ mFocusHandler->getModalFocused() &&
+ !widget->isModalFocused())
+ {
break;
+ }
}
}