summaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-03-01 20:18:59 +0100
committerGitHub <noreply@github.com>2019-03-01 20:18:59 +0100
commit03862d43ad1fecfde33baf9e4283270b485cb4f5 (patch)
tree9bea6a365d151899f40c674ccdb979b6acb5aa98 /scene/resources
parent3ece0004fab6da2be63a476fe795e52d6a1205ec (diff)
parent9d41ee71f6caf0ce9ae1778f5bb6701dfc2f95bb (diff)
Merge pull request #26441 from QbieShay/fix_sigill_when_no_parent_escn
Engine does not crash anymore if a non root node in escn is missing a parent.
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/packed_scene.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp
index 0d12d388ef..99440ff202 100644
--- a/scene/resources/packed_scene.cpp
+++ b/scene/resources/packed_scene.cpp
@@ -92,6 +92,8 @@ Node *SceneState::instance(GenEditState p_edit_state) const {
if (i > 0) {
+ ERR_EXPLAIN(vformat("Invalid scene: node %s does not specify its parent node.", snames[n.name]))
+ ERR_FAIL_COND_V(n.parent == -1, NULL)
NODE_FROM_ID(nparent, n.parent);
#ifdef DEBUG_ENABLED
if (!nparent && (n.parent & FLAG_ID_IS_PATH)) {