summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2018-01-05 19:02:54 -0300
committerJuan Linietsky <reduzio@gmail.com>2018-01-05 19:02:54 -0300
commit061db1ca95ff3476069a501cc96f14c479789c83 (patch)
treedfb3b7c5f4667254b8a027c1deecb6e52332e679 /editor
parentb1ab44aa05994a19f0bae5e700c4007b870a8ecf (diff)
Avoid crashing when dependencies on inherited/instanced scenes cant be satisfied, fixes #15298
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_node.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 7f8ee79304..8609697518 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -1021,7 +1021,7 @@ void EditorNode::_save_scene(String p_file, int idx) {
current_option = -1;
accept->get_ok()->set_text(TTR("I see.."));
- accept->set_text(TTR("Couldn't save scene. Likely dependencies (instances) couldn't be satisfied."));
+ accept->set_text(TTR("Couldn't save scene. Likely dependencies (instances or inheritance) couldn't be satisfied."));
accept->popup_centered_minsize();
return;
}
@@ -1029,6 +1029,13 @@ void EditorNode::_save_scene(String p_file, int idx) {
// force creation of node path cache
// (hacky but needed for the tree to update properly)
Node *dummy_scene = sdata->instance(PackedScene::GEN_EDIT_STATE_INSTANCE);
+ if (!dummy_scene) {
+ current_option = -1;
+ accept->get_ok()->set_text(TTR("I see.."));
+ accept->set_text(TTR("Couldn't save scene. Likely dependencies (instances or inheritance) couldn't be satisfied."));
+ accept->popup_centered_minsize();
+ return;
+ }
memdelete(dummy_scene);
int flg = 0;