[BUG] FSH.BlazorWebAssembly.Client.Shared.BaseLayout.SetCurrentTheme - Null Ref while using Azure Auth
274188A opened this issue · comments
While using AzureAd Auth I see the error (below) in the browser tools (so client side wasm) - probably due to the fact we are kind of skip showing thoese controls completely when in AzureAd Auth mode
blazor.webassembly.js:1
crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
at MudBlazor.Utilities.MudColor..ctor(String value)
at MudBlazor.Utilities.MudColor.op_Implicit(String input)
at FSH.BlazorWebAssembly.Client.Shared.BaseLayout.SetCurrentTheme(ClientPreference themePreference) in C:\Users\274188A\source\repos\CLEAN\WASM\blazor-wasm-boilerplate\src\Client\Shared\BaseLayout.razor.cs:line 49
at FSH.BlazorWebAssembly.Client.Shared.BaseLayout.OnInitializedAsync() in C:\Users\274188A\source\repos\CLEAN\WASM\blazor-wasm-boilerplate\src\Client\Shared\BaseLayout.razor.cs:line 24
at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
I don't see this problem. What are the exact steps to reproduce? Seems to be something with your themepreference? This is something that's stored in local storage. Maybe it still has some stale data from previous versions?
Have you checked your local storage? I bet there's a null value there somewhere in your themepreference which shouldn't be there...
There might be a bug somewhere how that null value got there in the first place (if it's not from doing some strange debugging stuff), but has nothing to do with AzureAd... ;-)
And that error message is probably fine... I think the signalr client always probes first without credentials, and only sends them after a 401 received.