diff options
-rw-r--r-- | scene/resources/packed_scene.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index dcccc6898b..fc261397c6 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -288,9 +288,11 @@ Node *SceneState::instantiate(GenEditState p_edit_state) const { // then tell this node to reference that resource. if (n.instance >= 0) { Ref<Resource> node_res = node->get(snames[nprops[j].name]); - node_res->copy_from(res); - node_res->configure_for_local_scene(node, resources_local_to_scene); - value = node_res; + if (node_res.is_valid()) { + node_res->copy_from(res); + node_res->configure_for_local_scene(node, resources_local_to_scene); + value = node_res; + } } else { HashMap<Ref<Resource>, Ref<Resource>>::Iterator E = resources_local_to_scene.find(res); Node *base = i == 0 ? node : ret_nodes[0]; |