Skip to content

Commit 395dca2

Browse files
committed
Resolve null reference crash in windows
1 parent 1ac7ff7 commit 395dca2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

maui/src/NumericEntry/SfNumericEntry.Methods.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2393,6 +2393,9 @@ private void UpdateTextBoxCursorPosition(string displayText, int caretPosition)
23932393
/// <param name="caretPosition">The position of the caret where input should be inserted.</param>
23942394
void InsertNumbers(string displayText, string selectedText, string input, int caretPosition)
23952395
{
2396+
#if WINDOWS
2397+
displayText ??= "";
2398+
#endif
23962399
displayText = displayText.Remove(caretPosition, Math.Min(selectedText.Length, displayText.Length - caretPosition));
23972400
string negativeSign = GetNegativeSign(GetNumberFormat());
23982401
bool isNegative = IsNegative(displayText, GetNumberFormat());

0 commit comments

Comments
 (0)