diff --git a/Classes/RestService.cs b/Classes/RestService.cs index 91b5b7b..f7aefe9 100644 --- a/Classes/RestService.cs +++ b/Classes/RestService.cs @@ -42,7 +42,7 @@ namespace Neighbourhood.omg.lol string str = await response.Content.ReadAsStringAsync(); try { OmgLolResponse? responseObj = await response.Content.ReadFromJsonAsync>(_serializerOptions, cancellationToken: cancellationToken); - if (responseObj != null && responseObj.Request.Success) { + if (responseObj?.Request?.Success ?? false) { responseData = responseObj.Response; } } @@ -66,7 +66,7 @@ namespace Neighbourhood.omg.lol string str = await response.Content.ReadAsStringAsync(); if (response.IsSuccessStatusCode) { OmgLolResponse? responseObj = await response.Content.ReadFromJsonAsync>(_serializerOptions, cancellationToken: cancellationToken); - if (responseObj != null && responseObj.Request.Success) { + if (responseObj?.Request?.Success ?? false) { responseData = responseObj.Response; } } @@ -87,7 +87,7 @@ namespace Neighbourhood.omg.lol HttpResponseMessage response = await _client.SendAsync(request, cancellationToken: cancellationToken); if (response.IsSuccessStatusCode) { OmgLolResponse? responseObj = await response.Content.ReadFromJsonAsync>(_serializerOptions, cancellationToken: cancellationToken); - if (responseObj != null && responseObj.Request.Success) { + if (responseObj?.Request?.Success ?? false) { responseData = responseObj.Response; } } @@ -106,7 +106,7 @@ namespace Neighbourhood.omg.lol string str = await response.Content.ReadAsStringAsync(); if (response.IsSuccessStatusCode) { OmgLolResponse? responseObj = await response.Content.ReadFromJsonAsync>(_serializerOptions, cancellationToken: cancellationToken); - if (responseObj != null && responseObj.Request.Success) { + if (responseObj?.Request?.Success ?? false) { responseData = responseObj.Response; } } @@ -126,7 +126,7 @@ namespace Neighbourhood.omg.lol string str = await response.Content.ReadAsStringAsync(); try { OmgLolResponse? responseObj = await response.Content.ReadFromJsonAsync>(_serializerOptions, cancellationToken: cancellationToken); - if (responseObj != null && responseObj.Request.Success) { + if (responseObj?.Request?.Success ?? false) { responseData = responseObj.Response; } } diff --git a/Components/Pages/Person.razor b/Components/Pages/Person.razor index 8057a82..3506f14 100644 --- a/Components/Pages/Person.razor +++ b/Components/Pages/Person.razor @@ -100,7 +100,7 @@ @code { - private string _address; + private string _address = string.Empty; [Parameter] public string Address { get => _address; @@ -121,8 +121,8 @@ public ExternalPageComponent? NowPage { get; set; } public ExternalPageComponent? ProfilePage { get; set; } - private StatusList StatusList { get; set; } - private PicList PicList { get; set; } + private StatusList? StatusList { get; set; } + private PicList? PicList { get; set; } private bool IsMe { get => Address == State.SelectedAddressName; diff --git a/Components/PicCard.razor b/Components/PicCard.razor index 6c33ccb..5b5c3ba 100644 --- a/Components/PicCard.razor +++ b/Components/PicCard.razor @@ -1,7 +1,7 @@ @inject IJSRuntime JS
- +