C
C#4w ago
biskit

Blazor Cascading value null exception even though instance exists

I get this error even though I think I created the instance at the top of the code block
No description
1 Reply
Harbour
Harbour4w ago
You say you’ve created it at the top of the code block but it’s throwing a null exception indicating it probably does not exist You could try initialise it via
[CascadingParameter] public GlobalUserInfo? userInfo {get;set;} = new GlobalUserInfo();
[CascadingParameter] public GlobalUserInfo? userInfo {get;set;} = new GlobalUserInfo();

Did you find this page helpful?