Skip to content

Commit ee18453

Browse files
fix null ref (#3266)
Co-authored-by: Gladwin Johnson <[email protected]>
1 parent 1657c13 commit ee18453

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/DevApps/blazor/BlazorApp/Components/Pages/Weather.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
}
4040
else
4141
{
42-
<p>Signed in user is @user.Identity.Name</p>
42+
<p>Signed in user is @user?.Identity?.Name</p>
4343
<table class="table">
4444
<thead>
4545
<tr>
@@ -64,7 +64,7 @@ else
6464
}
6565

6666
@code {
67-
private WeatherForecast[]? forecasts;
67+
private WeatherForecast[] forecasts = Array.Empty<WeatherForecast>();
6868
private ClaimsPrincipal? user;
6969

7070
protected override async Task OnInitializedAsync()

0 commit comments

Comments
 (0)