diff options
Diffstat (limited to 'scene/main')
-rw-r--r-- | scene/main/instance_placeholder.cpp | 2 | ||||
-rw-r--r-- | scene/main/scene_tree.cpp | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/scene/main/instance_placeholder.cpp b/scene/main/instance_placeholder.cpp index 71addd6fea..99ecc8bc37 100644 --- a/scene/main/instance_placeholder.cpp +++ b/scene/main/instance_placeholder.cpp @@ -92,6 +92,8 @@ Node *InstancePlaceholder::create_instance(bool p_replace, const Ref<PackedScene if (!ps.is_valid()) return NULL; Node *scene = ps->instance(); + if (!scene) + return NULL; scene->set_name(get_name()); int pos = get_position_in_parent(); diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index 2badf19f2b..dbf3150ae0 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -1507,8 +1507,11 @@ void SceneTree::_live_edit_instance_node_func(const NodePath &p_parent, const St Node *n2 = n->get_node(p_parent); Node *no = ps->instance(); - no->set_name(p_name); + if (!no) { + continue; + } + no->set_name(p_name); n2->add_child(no); } } |