summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-05-31 09:51:05 +0200
committerGitHub <noreply@github.com>2019-05-31 09:51:05 +0200
commit77880d1b4d43eea7f631d231e0fd7acb08c2d454 (patch)
treea85a835ef7e7a91c3c09dfe26272cb3d950f35fc /scene
parent4bcefb2268d0b62f2220be11c008bcf58c74d835 (diff)
parent9f29c28918e41a97266cbdd267fbba6e1ea5352f (diff)
Merge pull request #29299 from creikey/master
Check if parent is null before updating transform
Diffstat (limited to 'scene')
-rw-r--r--scene/3d/collision_shape.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/scene/3d/collision_shape.cpp b/scene/3d/collision_shape.cpp
index 3190e1e0b2..219ea56681 100644
--- a/scene/3d/collision_shape.cpp
+++ b/scene/3d/collision_shape.cpp
@@ -228,7 +228,9 @@ void CollisionShape::_update_debug_shape() {
void CollisionShape::_shape_changed() {
// If this is a heightfield shape our center may have changed
- _update_in_shape_owner(true);
+ if (parent) {
+ _update_in_shape_owner(true);
+ }
if (is_inside_tree() && get_tree()->is_debugging_collisions_hint() && !debug_shape_dirty) {
debug_shape_dirty = true;