Prechádzať zdrojové kódy

WindowDialog: Fix crash when running as ProjectManager

Fixes a bug introduced in #7970
Andreas Haas 8 rokov pred
rodič
commit
a2776af672
1 zmenil súbory, kde vykonal 2 pridanie a 2 odobranie
  1. 2 2
      scene/gui/dialogs.cpp

+ 2 - 2
scene/gui/dialogs.cpp

@@ -205,11 +205,11 @@ void WindowDialog::_notification(int p_what) {
 		} break;
 		} break;
 #ifdef TOOLS_ENABLED
 #ifdef TOOLS_ENABLED
 		case NOTIFICATION_POST_POPUP: {
 		case NOTIFICATION_POST_POPUP: {
-			if (get_tree() && get_tree()->is_editor_hint())
+			if (get_tree() && get_tree()->is_editor_hint() && EditorNode::get_singleton())
 				EditorNode::get_singleton()->dim_editor(true);
 				EditorNode::get_singleton()->dim_editor(true);
 		} break;
 		} break;
 		case NOTIFICATION_POPUP_HIDE: {
 		case NOTIFICATION_POPUP_HIDE: {
-			if (get_tree() && get_tree()->is_editor_hint())
+			if (get_tree() && get_tree()->is_editor_hint() && EditorNode::get_singleton())
 				EditorNode::get_singleton()->dim_editor(false);
 				EditorNode::get_singleton()->dim_editor(false);
 		} break;
 		} break;
 #endif
 #endif