From 3de9afc4a94932993532cb263ebbcd843865181d Mon Sep 17 00:00:00 2001 From: Markus Sauermann <6299227+Sauermann@users.noreply.github.com> Date: Thu, 23 Nov 2023 23:25:00 +0100 Subject: [PATCH] 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. --- scene/main/viewport.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 43bdb1395b6..e9ea09a3b1c 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -3207,7 +3207,9 @@ void Viewport::_update_mouse_over(Vector2 p_pos) { } // Send Mouse Enter Self notification. - gui.mouse_over->notification(Control::NOTIFICATION_MOUSE_ENTER_SELF); + if (gui.mouse_over) { + gui.mouse_over->notification(Control::NOTIFICATION_MOUSE_ENTER_SELF); + } notify_embedded_viewports = true; }