diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 295ec037022..e728a8807ee 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -522,8 +522,8 @@ void Control::_notification(int p_notification) { if (!is_visible()) { - - get_viewport()->_gui_hid_control(this); + if(get_viewport() != NULL) + get_viewport()->_gui_hid_control(this); _modal_stack_remove(); minimum_size_changed();