summaryrefslogtreecommitdiff
path: root/servers/physics_3d
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-09-30 09:59:09 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-09-30 09:59:09 +0200
commit300befdc9e0fbe8d119f01f00b1bb8c69c3ccdb4 (patch)
treec3732c40038494b1016d749a29fbdfdfa1ad341f /servers/physics_3d
parentfe9f056623166af2007992250107ee2309e0b1c7 (diff)
parent8320e12ac1d0b71a1f5a2213a35aaf26378b4d9a (diff)
Merge pull request #66641 from timothyqiu/null-joint
Fix crash when executing `PhysicsServer2D.joint_clear`
Diffstat (limited to 'servers/physics_3d')
-rw-r--r--servers/physics_3d/godot_physics_server_3d.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/servers/physics_3d/godot_physics_server_3d.cpp b/servers/physics_3d/godot_physics_server_3d.cpp
index f3a589d469..68db5df144 100644
--- a/servers/physics_3d/godot_physics_server_3d.cpp
+++ b/servers/physics_3d/godot_physics_server_3d.cpp
@@ -1210,6 +1210,7 @@ RID GodotPhysicsServer3D::joint_create() {
void GodotPhysicsServer3D::joint_clear(RID p_joint) {
GodotJoint3D *joint = joint_owner.get_or_null(p_joint);
+ ERR_FAIL_NULL(joint);
if (joint->get_type() != JOINT_TYPE_MAX) {
GodotJoint3D *empty_joint = memnew(GodotJoint3D);
empty_joint->copy_settings_from(joint);