summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scene/2d/collision_shape_2d.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/scene/2d/collision_shape_2d.cpp b/scene/2d/collision_shape_2d.cpp
index dbe9d7179c..85751fc735 100644
--- a/scene/2d/collision_shape_2d.cpp
+++ b/scene/2d/collision_shape_2d.cpp
@@ -113,13 +113,14 @@ void CollisionShape2D::_notification(int p_what) {
break;
}
+ if (!shape.is_valid()) {
+ break;
+ }
+
rect=Rect2();
Color draw_col=get_tree()->get_debug_collisions_color();
- if(!shape.is_valid()) {
- break;
- }
shape->draw(get_canvas_item(),draw_col);