From f20d3a55ec00adbc4b284f0512b91981083980a5 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 15 Nov 2009 13:50:49 +0000 Subject: [PATCH] (svn r18093) -Fix: the mouseover handler could crash if there wasn't a widget under the mouse --- src/window.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.cpp b/src/window.cpp index caf9f28404..224031a2e4 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -1333,8 +1333,8 @@ static bool HandleMouseOver() if (w != NULL) { /* send an event in client coordinates. */ Point pt = { _cursor.pos.x - w->left, _cursor.pos.y - w->top }; - int widget = w->nested_root->GetWidgetFromPos(pt.x, pt.y)->index; - w->OnMouseOver(pt, widget); + const NWidgetCore *widget = w->nested_root->GetWidgetFromPos(pt.x, pt.y); + if (widget != NULL) w->OnMouseOver(pt, widget->index); } /* Mouseover never stops execution */