Blazored / Toast

A JavaScript free toast library for Blazor and Razor Component applications
https://blazored.github.io/Toast/
MIT License
654 stars 90 forks source link

251 - Fix null reference exception in OnInitializedAsync #255

Closed gracefaz closed 5 months ago

gracefaz commented 5 months ago

Resolves: https://github.com/Blazored/Toast/issues/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.