summaryrefslogtreecommitdiff
path: root/scene/resources/shape_3d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources/shape_3d.cpp')
-rw-r--r--scene/resources/shape_3d.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/scene/resources/shape_3d.cpp b/scene/resources/shape_3d.cpp
index 4423c1d7bb..44f21d2a48 100644
--- a/scene/resources/shape_3d.cpp
+++ b/scene/resources/shape_3d.cpp
@@ -128,5 +128,7 @@ Shape3D::Shape3D(RID p_shape) :
shape(p_shape) {}
Shape3D::~Shape3D() {
- PhysicsServer3D::get_singleton()->free(shape);
+ if (PhysicsServer3D::get_singleton() != nullptr) {
+ PhysicsServer3D::get_singleton()->free(shape);
+ }
}