diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index b395c908439e..f9d02a83fac7 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1771,8 +1771,7 @@ void Viewport::_gui_input_event(Ref p_event) { } } - bool stopped = gui.mouse_focus->can_process() && _gui_call_input(gui.mouse_focus, mb); - + bool stopped = gui.mouse_focus && gui.mouse_focus->can_process() && _gui_call_input(gui.mouse_focus, mb); if (stopped) { set_input_as_handled(); }