You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In 4.2.0, Settings.ShowProgressBar is null in BlazoredToast.OnInitializedAsync when using a ToastService.ShowToast method without explicitly providing optional settings that override ShowProgressBar.
Error: System.InvalidOperationException: Nullable object must have a value.
at System.Nullable`1.get_Value()
at Blazored.Toast.BlazoredToast.OnInitializedAsync()
at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
It looks like the breaking changes were in the following commit which changed ShowProgressBar from bool to bool?
We have been able to recreate this in the repo 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.
Version is 4.2.1 and I have the issue: NullReferenceException: Object reference not set to an instance of an object.
Blazored.Toast.BlazoredToast.OnInitializedAsync()
I just have <BlazoredToast /> in MainLayout.razor on the client and it throws on app startup in the browser.
If we need to provide ToastSettings it is very inconvenient because it requires a bunch of arguments provided.
In 4.2.0, Settings.ShowProgressBar is null in BlazoredToast.OnInitializedAsync when using a ToastService.ShowToast method without explicitly providing optional settings that override ShowProgressBar.
ex.
_toastService.ShowToast<Alert>(toastParameters);
This leads to the following runtime error:
It looks like the breaking changes were in the following commit which changed ShowProgressBar from
bool
tobool?
Fix settings to allow instance settings to override global settings (https://github.com/Blazored/Toast/pull/226[)](https://github.com/Blazored/Toast/commit/1f0f1d839ea0177798f6712aff29646fbbacc78a)
BlazoredToasts.BuildCustomToastSettings(Action? settings) might need to define a sensible default.
The text was updated successfully, but these errors were encountered: