summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2015-09-22 20:27:48 -0300
committerGeorge Marques <george@gmarqu.es>2015-09-22 20:27:48 -0300
commite68f04b9d07b6128eb05bc6ca042c986c6501e90 (patch)
treeecd01cd2219156d7ce30dc67fbf35622d7fa934a /scene
parent4fef36825ebbbe4c3f9ecbd5a4cf052dbf309f9a (diff)
Check if shape is valid before referencing it
See the comment from @MartiniMoe at #2366.
Diffstat (limited to 'scene')
-rw-r--r--scene/2d/collision_shape_2d.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/scene/2d/collision_shape_2d.cpp b/scene/2d/collision_shape_2d.cpp
index cd89e914fb..dbe9d7179c 100644
--- a/scene/2d/collision_shape_2d.cpp
+++ b/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);