소스 검색

Check if shape is valid before referencing it

See the comment from @MartiniMoe at #2366.
George Marques 10 년 전
부모
커밋
e68f04b9d0
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      scene/2d/collision_shape_2d.cpp

+ 3 - 0
scene/2d/collision_shape_2d.cpp

@@ -117,6 +117,9 @@ void CollisionShape2D::_notification(int p_what) {
 
 
 			Color draw_col=get_tree()->get_debug_collisions_color();
+            if(!shape.is_valid()) {
+                break;
+            }
 			shape->draw(get_canvas_item(),draw_col);