Skip to content

Fix: possible NullReferenceException in PasswordBox#1091

Merged
pomianowski merged 1 commit intolepoco:developmentfrom
textGamex:fix-bug
Jun 2, 2024
Merged

Fix: possible NullReferenceException in PasswordBox#1091
pomianowski merged 1 commit intolepoco:developmentfrom
textGamex:fix-bug

Conversation

@textGamex
Copy link
Copy Markdown
Contributor

@textGamex textGamex commented May 18, 2024

Pull request type

Please check the type of change your PR introduces:

  • Update
  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes

What is the current behavior?

In the current version v3.0.4, binding the Password property of the PasswordBox control to a null property results in a NullReferenceException being thrown

<ui:PasswordBox Password="{Binding Password}" />
public partial class MainWindow : Window
{
    public MainWindowsViewModel Context { get; set; }
    public MainWindow()
    {
        Context = new MainWindowsViewModel();
        DataContext = Context;
        InitializeComponent();
    }
}

public partial class MainWindowsViewModel : ObservableObject
{
    [ObservableProperty]
    private string? _password = null;
}

screenshot
screenshot

Issue Number: N/A

What is the new behavior?

  • Fix this bug.

Other information

@textGamex textGamex requested a review from pomianowski as a code owner May 18, 2024 17:23
@github-actions github-actions Bot added controls Changes to the appearance or logic of custom controls. PR Pull request dotnet labels May 18, 2024
@textGamex textGamex changed the title Fix: possible null reference exceptions in PasswordBox Fix: possible NullReferenceException in PasswordBox May 18, 2024
@pomianowski pomianowski merged commit 259faf2 into lepoco:development Jun 2, 2024
@textGamex textGamex deleted the fix-bug branch June 2, 2024 11:40
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jun 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

controls Changes to the appearance or logic of custom controls. dotnet PR Pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants