summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-12-26 11:43:02 -0300
committerGitHub <noreply@github.com>2017-12-26 11:43:02 -0300
commit02e883713aa4a36c83e64d242c8bd009f89d10c3 (patch)
tree64c49ccb9f854424c482e7acae44654b245f2c87 /scene
parent2b31155baa48788327c927007decc4621a6bf19a (diff)
parentff68b80df7e08a2fcae3b3ace56be1d9bee73235 (diff)
Merge pull request #14977 from volzhs/fix-crash-group
Fix crash & error at saving scene
Diffstat (limited to 'scene')
-rw-r--r--scene/3d/camera.cpp5
-rw-r--r--scene/main/node.cpp3
2 files changed, 6 insertions, 2 deletions
diff --git a/scene/3d/camera.cpp b/scene/3d/camera.cpp
index c74abb7e2d..7143310036 100644
--- a/scene/3d/camera.cpp
+++ b/scene/3d/camera.cpp
@@ -70,6 +70,9 @@ void Camera::_validate_property(PropertyInfo &p_property) const {
void Camera::_update_camera() {
+ if (!is_inside_tree())
+ return;
+
Transform tr = get_camera_transform();
tr.origin += tr.basis.get_axis(1) * v_offset;
tr.origin += tr.basis.get_axis(0) * h_offset;
@@ -81,7 +84,7 @@ void Camera::_update_camera() {
get_viewport()->_camera_transform_changed_notify();
*/
- if (!is_inside_tree() || get_tree()->is_node_being_edited(this) || !is_current())
+ if (get_tree()->is_node_being_edited(this) || !is_current())
return;
get_viewport()->_camera_transform_changed_notify();
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index de1ab9959a..942a6d5428 100644
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -340,7 +340,8 @@ void Node::move_child(Node *p_child, int p_pos) {
data.children[i]->notification(NOTIFICATION_MOVED_IN_PARENT);
}
for (const Map<StringName, GroupData>::Element *E = p_child->data.grouped.front(); E; E = E->next()) {
- E->get().group->changed = true;
+ if (E->get().group)
+ E->get().group->changed = true;
}
data.blocked--;