summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-10-23 18:33:12 +0200
committerGitHub <noreply@github.com>2021-10-23 18:33:12 +0200
commite12fe670e6e82ab5386c5c4d0be1ed5037c64143 (patch)
treeb1010301caaf6d48436d274db82869c41e49b3d1
parentaec383a83e0d5255c868e83e1406e6b5da3b9d2b (diff)
parent5c25497aa239a0ffa8f367327f124871b001384b (diff)
Merge pull request #54145 from zedutch/Fix-tree-notification-crash
-rw-r--r--scene/gui/tree.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index 3f041bf65a..992d364464 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -3570,7 +3570,9 @@ int Tree::_get_title_button_height() const {
void Tree::_notification(int p_what) {
if (p_what == NOTIFICATION_FOCUS_ENTER) {
- focus_in_id = get_viewport()->get_processed_events_count();
+ if (get_viewport()) {
+ focus_in_id = get_viewport()->get_processed_events_count();
+ }
}
if (p_what == NOTIFICATION_MOUSE_EXIT) {
if (cache.hover_type != Cache::CLICK_NONE) {