summaryrefslogtreecommitdiff
path: root/scene/gui/tree.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-11-06 22:13:19 +0100
committerGitHub <noreply@github.com>2018-11-06 22:13:19 +0100
commit1e6537bcc8f79b00ff28275277a62e3e94cdd894 (patch)
tree925e76f570b441430b1a45a0e6c10af4d9e1c3da /scene/gui/tree.cpp
parenta8e79f1a6557b03a5c578f0130aa2f76620ac7c3 (diff)
parent34d1cea6b88b2ea6a4c9e31a188d90a6cef18a89 (diff)
Merge pull request #23537 from fire/visualscript-virtual-_function-crash-23536
Fix creating a visual script virtual function after minimizing crashes #23536 and misc vs warning
Diffstat (limited to 'scene/gui/tree.cpp')
-rw-r--r--scene/gui/tree.cpp2
1 files changed, 1 insertions, 1 deletions
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<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);