Skip to content

Commit 3de9afc

Browse files
committed
Fix crash when hiding a Control during mouse-entering
gui.mouse_over can be set to `nullptr` in the `NOTIFICATION_MOUSE_ENTER`- user-callback a few lines above. This case was previously not handled.
1 parent ce3bac5 commit 3de9afc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scene/main/viewport.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3207,7 +3207,9 @@ void Viewport::_update_mouse_over(Vector2 p_pos) {
32073207
}
32083208

32093209
// Send Mouse Enter Self notification.
3210-
gui.mouse_over->notification(Control::NOTIFICATION_MOUSE_ENTER_SELF);
3210+
if (gui.mouse_over) {
3211+
gui.mouse_over->notification(Control::NOTIFICATION_MOUSE_ENTER_SELF);
3212+
}
32113213

32123214
notify_embedded_viewports = true;
32133215
}

0 commit comments

Comments
 (0)