Check if shape is valid before referencing it

See the comment from @MartiniMoe at #2366.
This commit is contained in:
George Marques 2015-09-22 20:27:48 -03:00
parent 4fef36825e
commit e68f04b9d0
1 changed files with 3 additions and 0 deletions

View File

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