Commit cf791b74 authored by cutealien's avatar cutealien

Fix recently introduced crash when there is no hovered element but a focused...

Fix recently introduced crash when there is no hovered element but a focused gui element. Thanks @  christianclavet for reporting.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4805 dfc29bdd-3216-0410-991c-e03cc46cb475
parent b28f69b3
......@@ -580,7 +580,7 @@ bool CGUIEnvironment::postEventFromUser(const SEvent& event)
IGUIElement * focusCandidate = Hovered;
// Only allow enabled elements to be focused (unless EFF_CAN_FOCUS_DISABLED is set)
if ( !Hovered->isEnabled() && !(FocusFlags & EFF_CAN_FOCUS_DISABLED))
if ( Hovered && !Hovered->isEnabled() && !(FocusFlags & EFF_CAN_FOCUS_DISABLED))
focusCandidate = NULL; // we still remove focus from the active element
// Please don't merge this into a single if clause, it's easier to debug the way it is
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment