From eb2deabffe7cea3f584ce152781445714cda0ff9 Mon Sep 17 00:00:00 2001 From: BrunoSXS Date: Sat, 23 Oct 2021 17:30:18 -0300 Subject: Fixes a game crash caused by instantiating Camera2D and sending a notification from it before adding it to the tree. --- scene/main/canvas_item.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'scene/main') diff --git a/scene/main/canvas_item.cpp b/scene/main/canvas_item.cpp index 916833c9a7..232c522a47 100644 --- a/scene/main/canvas_item.cpp +++ b/scene/main/canvas_item.cpp @@ -274,6 +274,7 @@ void CanvasItem::_exit_canvas() { void CanvasItem::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { + ERR_FAIL_COND(!is_inside_tree()); _update_texture_filter_changed(false); _update_texture_repeat_changed(false); -- cgit v1.2.3