summaryrefslogtreecommitdiff
path: root/scene/2d/ray_cast_2d.cpp
diff options
context:
space:
mode:
authorZae <zaevi@live.com>2021-10-22 19:44:38 +0800
committerZae <zaevi@live.com>2021-10-23 13:01:52 +0800
commit924c2078dae69e73032af04e96200f44187d2c8d (patch)
treedcc13350670b4c231e45a6b120f9f1d1e42d9c5d /scene/2d/ray_cast_2d.cpp
parentfe3d62f2dc9a9bb37b6f9a1e17a7f16fa153aca8 (diff)
Fix unexpected crashes in `notification`
Diffstat (limited to 'scene/2d/ray_cast_2d.cpp')
-rw-r--r--scene/2d/ray_cast_2d.cpp1
1 files changed, 1 insertions, 0 deletions
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;
}