mirror of
https://github.com/godotengine/godot
synced 2024-09-05 02:48:34 +00:00
Fix possible crash when calling Tree.notification from _ready
This commit is contained in:
parent
f1f51f5d4b
commit
5c25497aa2
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue