Fixed crash in ScrollContainer _notification

(cherry picked from commit ee81979f90)
This commit is contained in:
Anton Christoffersson 2021-10-23 12:48:43 +02:00 committed by Rémi Verschelde
parent 8fd0fe3d20
commit 62db47a7fb
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -257,7 +257,9 @@ void ScrollContainer::_notification(int p_what) {
};
if (p_what == NOTIFICATION_READY) {
get_viewport()->connect("gui_focus_changed", this, "_gui_focus_changed");
Viewport *viewport = get_viewport();
ERR_FAIL_COND(!viewport);
viewport->connect("gui_focus_changed", this, "_gui_focus_changed");
}
if (p_what == NOTIFICATION_SORT_CHILDREN) {