summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-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);