From 0f6632630448d0b965ec7cae7ca50f94e0dab61a Mon Sep 17 00:00:00 2001 From: textGamex Date: Sun, 19 May 2024 00:59:13 +0800 Subject: [PATCH] fix: possible null reference exceptions in PasswordBox --- 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 2d7be4f91..bf13893a1 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)