Browse Source

Merge pull request #2504 from vnen/fix-collisionshape-add-bug

Check if shape is valid before referencing it
Juan Linietsky 10 years ago
parent
commit
eea52d44c7
1 changed files with 4 additions and 0 deletions
  1. 4 0
      scene/2d/collision_shape_2d.cpp

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

@@ -113,6 +113,10 @@ void CollisionShape2D::_notification(int p_what) {
 				break;
 			}
 
+			if (!shape.is_valid()) {
+				break;
+			}
+
 			rect=Rect2();