Fix creating a visual script virtual function after minimizing crashes #23536

This commit is contained in:
K. S. Ernest (iFire) Lee 2018-11-05 13:48:27 -08:00
parent 3cf3c4137a
commit 562d241b13

View file

@ -2519,7 +2519,7 @@ void Tree::_gui_input(Ref<InputEvent> 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);