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

251 - Fix null reference exception in OnInitializedAsync #255

Conversation

gracefaz
Copy link
Contributor

@gracefaz gracefaz commented Mar 19, 2024

Resolves: #251

This issue can be recreated by using the ShowToast<TComponent> method where ToastSettings is not a parameter. This method sets ToastSettings to null which resulted in ShowProgressBar also being null. According to this line, ShowProgressBar cannot be null.

We are now handling this similarly to how we handle the other parameters in ToastSettings.

We are unable to add test coverage for this change with the current infrastructure as we would need to render a toast message.

Copy link
Member

@chrissainty chrissainty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks @gracefaz!

@chrissainty chrissainty merged commit 6e2959a into Blazored:main Mar 19, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] BlazoredToast.OnInitializedAsync null reference exception in 4.2.0
2 participants