From 1dfdd6834eb5fe515e4edb86cccad19849345f4a Mon Sep 17 00:00:00 2001 From: hedin Date: Thu, 27 Dec 2018 19:29:47 +0200 Subject: [PATCH] fixes crash when Body2DSW doesn't have space --- servers/physics_2d/physics_2d_server_sw.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/servers/physics_2d/physics_2d_server_sw.cpp b/servers/physics_2d/physics_2d_server_sw.cpp index 45310ec4b39..0eb22c25203 100644 --- a/servers/physics_2d/physics_2d_server_sw.cpp +++ b/servers/physics_2d/physics_2d_server_sw.cpp @@ -1079,6 +1079,7 @@ Physics2DDirectBodyState *Physics2DServerSW::body_get_direct_state(RID p_body) { Body2DSW *body = body_owner.get(p_body); ERR_FAIL_COND_V(!body, NULL); + ERR_FAIL_COND_V(!body->get_space(), NULL); if (body->get_space()->is_locked()) {