diff options
author | Anton Christoffersson <anton_christoffersson@hotmail.com> | 2021-10-23 12:48:43 +0200 |
---|---|---|
committer | Anton Christoffersson <anton_christoffersson@hotmail.com> | 2021-10-23 14:03:26 +0200 |
commit | ee81979f901e096fab84109b3e66aa1238d1abd2 (patch) | |
tree | 2c2230b82b35f8350ef0df801c45cefede54a37a /scene/gui | |
parent | 11efbd582e8c5fa9213ab86b54b04c27e4755522 (diff) |
Fixed crash in `ScrollContainer` _notification
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/scroll_container.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp index 0c0ec39c7f..6e1e1bb5ea 100644 --- a/scene/gui/scroll_container.cpp +++ b/scene/gui/scroll_container.cpp @@ -320,7 +320,9 @@ void ScrollContainer::_notification(int p_what) { }; if (p_what == NOTIFICATION_READY) { - get_viewport()->connect("gui_focus_changed", callable_mp(this, &ScrollContainer::_gui_focus_changed)); + Viewport* viewport = get_viewport(); + ERR_FAIL_COND(!viewport); + viewport->connect("gui_focus_changed", callable_mp(this, &ScrollContainer::_gui_focus_changed)); _update_dimensions(); } |