Skip to content

Commit 50c439f

Browse files
authored
OSOE-754: Fix nullability warnings (#706)
* Fix nullability warnings. * Update HL nuget version.
1 parent de8416e commit 50c439f

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
should use Orchard Core references for the latest patch version to pull all versions up in the final app. -->
99
<OrchardCoreVersion>2.1.0</OrchardCoreVersion>
1010

11-
<LombiqHelpfulLibrariesVersion>12.5.0</LombiqHelpfulLibrariesVersion>
11+
<LombiqHelpfulLibrariesVersion>12.5.1-alpha.1.osoe-754</LombiqHelpfulLibrariesVersion>
1212
<LombiqTestsUIVersion>14.2.0</LombiqTestsUIVersion>
1313
</PropertyGroup>
1414

src/Modules/OrchardCore.Commerce.Payment/Controllers/PaymentBaseController.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ protected async Task<IActionResult> ProduceActionResultAsync(PaymentOperationSta
5858

5959
PaymentOperationStatus.NotFound => NotFound(),
6060

61-
PaymentOperationStatus.NotThingToDo => this.RedirectToContentDisplay(paidStatusViewModel.Content),
61+
PaymentOperationStatus.NotThingToDo => paidStatusViewModel.Content is { } content
62+
? this.RedirectToContentDisplay(content)
63+
: NotFound(),
6264

6365
PaymentOperationStatus.WaitingForRedirect => Redirect(url: paidStatusViewModel.Url),
6466

src/Modules/OrchardCore.Commerce.Payment/Services/DummyPaymentProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public DummyPaymentProvider(
4040
// This provider doesn't have any special data, and it should only be displayed during development even if the
4141
// feature is enabled. So if the condition is met a blank object is returned, otherwise null which will cause
4242
// the provider to be skipped when used through the viewModel.WithProviderDataAsync(providers) method.
43-
Task.FromResult(_hca.HttpContext.IsDevelopmentAndLocalhost() ? new object() : null);
43+
Task.FromResult(_hca.HttpContext?.IsDevelopmentAndLocalhost() == true ? new object() : null);
4444

4545
public async Task<PaymentOperationStatusViewModel> UpdateAndRedirectToFinishedOrderAsync(
4646
ContentItem order,

src/Modules/OrchardCore.Commerce.Payment/Services/PaymentService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ private async Task<bool> HandleErrorsAsync(IList<string> errors, bool notifyOnEr
361361
public async Task<IList<string>> UpdateOrderWithDriversAsync(ContentItem order)
362362
{
363363
await _contentItemDisplayManager.UpdateEditorAsync(order, _updateModelAccessor.ModelUpdater, isNew: false);
364-
return _updateModelAccessor.ModelUpdater.GetModelErrorMessages()?.AsList() ?? Array.Empty<string>();
364+
return _updateModelAccessor.ModelUpdater.GetModelErrorMessages().AsList();
365365
}
366366

367367
public async Task UpdateOrderToOrderedAsync(
@@ -459,7 +459,7 @@ await _paymentProvidersLazy
459459
exception,
460460
"An exception has occurred during checkout form validation for shopping cart ID {ShoppingCartId}.",
461461
shoppingCartIdForDisplay);
462-
var errorMessage = _hca.HttpContext.IsDevelopmentAndLocalhost()
462+
var errorMessage = _hca.HttpContext?.IsDevelopmentAndLocalhost() == true
463463
? exception.ToString()
464464
: H["An exception has occurred during checkout form validation for shopping cart ID {0}.", shoppingCartIdForDisplay].Value;
465465

0 commit comments

Comments
 (0)