From 562d241b13acda02245cabab16548532257a7a8f Mon Sep 17 00:00:00 2001 From: "K. S. Ernest (iFire) Lee" Date: Mon, 5 Nov 2018 13:48:27 -0800 Subject: Fix creating a visual script virtual function after minimizing crashes #23536 --- scene/gui/tree.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scene/gui/tree.cpp') diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 0c11181f98..31f7a21114 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -2519,7 +2519,7 @@ void Tree::_gui_input(Ref p_event) { pressing_for_editor = false; } - if (cache.click_type == Cache::CLICK_BUTTON) { + if (cache.click_type == Cache::CLICK_BUTTON && cache.click_item != NULL) { // make sure in case of wrong reference after reconstructing whole TreeItems cache.click_item = get_item_at_position(cache.click_pos); emit_signal("button_pressed", cache.click_item, cache.click_column, cache.click_id); -- cgit v1.2.3