瀏覽代碼

fixes crash when Body2DSW doesn't have space

hedin 6 年之前
父節點
當前提交
1dfdd6834e
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      servers/physics_2d/physics_2d_server_sw.cpp

+ 1 - 0
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()) {