From c1410af0d5edca7db2ca136c6e94131a563bd212 Mon Sep 17 00:00:00 2001 From: mrmandrake Date: Wed, 18 Jan 2023 00:47:50 +0100 Subject: [PATCH] Update TextInputResponder.cs fixes #9956 --- src/iOS/Avalonia.iOS/TextInputResponder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/iOS/Avalonia.iOS/TextInputResponder.cs b/src/iOS/Avalonia.iOS/TextInputResponder.cs index d5723d78f7..8862f4e392 100644 --- a/src/iOS/Avalonia.iOS/TextInputResponder.cs +++ b/src/iOS/Avalonia.iOS/TextInputResponder.cs @@ -445,7 +445,7 @@ partial class AvaloniaView UITextPosition IUITextInput.BeginningOfDocument => _beginningOfDocument; - private int DocumentLength => _client.SurroundingText.Text.Length + (_markedText?.Length ?? 0); + private int DocumentLength => (_client.SurroundingText.Text?.Length ?? 0) + (_markedText?.Length ?? 0); UITextPosition IUITextInput.EndOfDocument => new AvaloniaTextPosition(DocumentLength); UITextRange IUITextInput.MarkedTextRange