summaryrefslogtreecommitdiff
path: root/scene/resources/shape_2d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources/shape_2d.cpp')
-rw-r--r--scene/resources/shape_2d.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/scene/resources/shape_2d.cpp b/scene/resources/shape_2d.cpp
index af84144591..413670d23e 100644
--- a/scene/resources/shape_2d.cpp
+++ b/scene/resources/shape_2d.cpp
@@ -124,5 +124,7 @@ Shape2D::Shape2D(const RID &p_rid) {
}
Shape2D::~Shape2D() {
- PhysicsServer2D::get_singleton()->free(shape);
+ if (PhysicsServer2D::get_singleton() != nullptr) {
+ PhysicsServer2D::get_singleton()->free(shape);
+ }
}