summaryrefslogtreecommitdiff
path: root/src/gui/gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r--src/gui/gui.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index c5d6bc95c..3fab73d0a 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -1467,7 +1467,8 @@ void Gui::handleModalFocusReleased()
Widget* widget = getMouseEventSource(mLastMouseX, mLastMouseY);
Widget* parent = widget;
- while (parent != nullptr)
+ while (parent != nullptr &&
+ widget != nullptr)
{
parent = widget->getParent();