From 259faf2baea61a2eb71d7e207833d0c754049089 Mon Sep 17 00:00:00 2001 From: textGamex Date: Sun, 2 Jun 2024 19:12:37 +0800 Subject: [PATCH] fix: possible null reference exceptions in PasswordBox (#1091) --- src/Wpf.Ui/Controls/PasswordBox/PasswordBox.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Wpf.Ui/Controls/PasswordBox/PasswordBox.cs b/src/Wpf.Ui/Controls/PasswordBox/PasswordBox.cs index d888b18f8..d49a0d341 100644 --- a/src/Wpf.Ui/Controls/PasswordBox/PasswordBox.cs +++ b/src/Wpf.Ui/Controls/PasswordBox/PasswordBox.cs @@ -237,7 +237,7 @@ private void UpdateTextContents(bool isTriggeredByTextInput) var caretIndex = CaretIndex; var selectionIndex = SelectionStart; - var currentPassword = Password; + var currentPassword = Password ?? string.Empty; var newPasswordValue = currentPassword; if (isTriggeredByTextInput)