summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-11-16 14:13:21 +0100
committerGitHub <noreply@github.com>2021-11-16 14:13:21 +0100
commit1edbe4f3c1626d20511bd2741435263fc3d542a7 (patch)
tree936b5df1a86e53c6222c5aae17d305dfb44b51f4 /scene/gui
parentb99792b5d9e85169b82127efe2ade563cc363b27 (diff)
parentee81979f901e096fab84109b3e66aa1238d1abd2 (diff)
Merge pull request #54148 from miraz12/fix-scrollContrainer-notification-crash
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/scroll_container.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp
index 013358e75c..2bb0ddb228 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();
}