Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: possible NullReferenceException in PasswordBox #1091

Merged
merged 1 commit into from
Jun 2, 2024

Conversation

textGamex
Copy link

@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

@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
2 checks passed
@textGamex textGamex deleted the fix-bug branch June 2, 2024 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.

None yet

2 participants