diff --git a/src/Core/src/Platform/iOS/KeyboardAutoManagerScroll.cs b/src/Core/src/Platform/iOS/KeyboardAutoManagerScroll.cs index fb5a8713a617..a88e58ae14b2 100644 --- a/src/Core/src/Platform/iOS/KeyboardAutoManagerScroll.cs +++ b/src/Core/src/Platform/iOS/KeyboardAutoManagerScroll.cs @@ -1,4 +1,4 @@ -/* +/* * This class is adapted from IQKeyboardManager which is an open-source * library implemented for iOS to handle Keyboard interactions with * UITextFields/UITextViews. Link to their MIT License can be found here: @@ -309,7 +309,12 @@ internal static void AdjustPosition() TopViewBeginOrigin = new CGPoint(ContainerView.Frame.X, ContainerView.Frame.Y); var rootViewOrigin = new CGPoint(ContainerView.Frame.GetMinX(), ContainerView.Frame.GetMinY()); - var window = ContainerView.Window; + var window = ContainerView?.Window; + + if (window is null) + { + return; + } var intersectRect = CGRect.Intersect(KeyboardFrame, window.Frame); var kbSize = intersectRect == CGRect.Empty ? new CGSize(KeyboardFrame.Width, 0) : intersectRect.Size;