From 924c2078dae69e73032af04e96200f44187d2c8d Mon Sep 17 00:00:00 2001 From: Zae Date: Fri, 22 Oct 2021 19:44:38 +0800 Subject: Fix unexpected crashes in `notification` --- scene/2d/ray_cast_2d.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'scene/2d/ray_cast_2d.cpp') diff --git a/scene/2d/ray_cast_2d.cpp b/scene/2d/ray_cast_2d.cpp index 3ac2128c2e..0a8e9e2a58 100644 --- a/scene/2d/ray_cast_2d.cpp +++ b/scene/2d/ray_cast_2d.cpp @@ -157,6 +157,7 @@ void RayCast2D::_notification(int p_what) { } break; case NOTIFICATION_DRAW: { + ERR_FAIL_COND(!is_inside_tree()); if (!Engine::get_singleton()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) { break; } -- cgit v1.2.3