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