From 2274c34f076fe78a792f16f6ea0b6b246a0d5312 Mon Sep 17 00:00:00 2001 From: Gordon Pedersen Date: Tue, 2 Jul 2024 10:29:50 +1000 Subject: [PATCH] Cleaned up more warnings --- Classes/RestService.cs | 10 +++++----- Components/Pages/Person.razor | 6 +++--- Components/PicCard.razor | 2 +- Components/StatusCard.razor | 2 +- Models/API/AccountResponseData.cs | 19 +++++++------------ Models/API/AddressResponseData.cs | 8 ++++---- Models/API/BasicResponseData.cs | 2 +- Models/API/DirectoryResponseData.cs | 6 +++--- Models/API/EphemeralData.cs | 2 +- Models/API/EphemeralResponseData.cs | 4 ++-- Models/API/NowData.cs | 6 +++--- Models/API/NowPageResponseData.cs | 4 ++-- Models/API/NowResponseData.cs | 4 ++-- Models/API/OmgLolResponse.cs | 4 ++-- Models/API/PatchStatus.cs | 4 ++-- Models/API/PatchStatusResponseData.cs | 6 +++--- Models/API/PutPic.cs | 2 +- Models/API/PutPicResponseData.cs | 8 ++++---- Models/API/SomePicsResponseData.cs | 2 +- Models/API/StatusBioResponseData.cs | 8 ++++---- Models/API/StatusResponseData.cs | 4 ++-- Models/API/TokenResponseData.cs | 6 +++--- Models/Pic.cs | 10 +++++----- Models/Status.cs | 18 +++++++++--------- Models/TimeData.cs | 2 ++ XamlComponents/LoginWebViewPage.xaml.cs | 2 +- 26 files changed, 74 insertions(+), 77 deletions(-) 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
- +