summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-rw-r--r--scene/resources/shape_2d.cpp5
-rw-r--r--scene/resources/shape_3d.cpp5
2 files changed, 4 insertions, 6 deletions
diff --git a/scene/resources/shape_2d.cpp b/scene/resources/shape_2d.cpp
index 413670d23e..87c6c36ee9 100644
--- a/scene/resources/shape_2d.cpp
+++ b/scene/resources/shape_2d.cpp
@@ -124,7 +124,6 @@ Shape2D::Shape2D(const RID &p_rid) {
}
Shape2D::~Shape2D() {
- if (PhysicsServer2D::get_singleton() != nullptr) {
- PhysicsServer2D::get_singleton()->free(shape);
- }
+ ERR_FAIL_NULL(PhysicsServer2D::get_singleton());
+ PhysicsServer2D::get_singleton()->free(shape);
}
diff --git a/scene/resources/shape_3d.cpp b/scene/resources/shape_3d.cpp
index 44f21d2a48..7992ba9fd4 100644
--- a/scene/resources/shape_3d.cpp
+++ b/scene/resources/shape_3d.cpp
@@ -128,7 +128,6 @@ Shape3D::Shape3D(RID p_shape) :
shape(p_shape) {}
Shape3D::~Shape3D() {
- if (PhysicsServer3D::get_singleton() != nullptr) {
- PhysicsServer3D::get_singleton()->free(shape);
- }
+ ERR_FAIL_NULL(PhysicsServer3D::get_singleton());
+ PhysicsServer3D::get_singleton()->free(shape);
}