From 00a591a14bffd7288e335bcf3c191bebf24fd5fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Chalet?= Date: Wed, 10 Jul 2024 08:10:37 +0200 Subject: [PATCH] React to ASWebAuthenticationSessionCompletionHandler.Error becoming nullable in .NET 9.0 --- ...IddictClientSystemIntegrationHandlers.Authentication.cs | 7 ++++++- .../OpenIddictClientSystemIntegrationHandlers.Session.cs | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlers.Authentication.cs b/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlers.Authentication.cs index 49cae0fd..c38c61c5 100644 --- a/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlers.Authentication.cs +++ b/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlers.Authentication.cs @@ -157,10 +157,15 @@ public static partial class OpenIddictClientSystemIntegrationHandlers source.SetResult(url); } - else + else if (error is not null) { source.SetException(new NSErrorException(error)); } + + else + { + source.SetException(new InvalidOperationException(SR.GetResourceString(SR.ID0448))); + } }); #if SUPPORTS_PRESENTATION_CONTEXT_PROVIDER diff --git a/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlers.Session.cs b/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlers.Session.cs index 9bc57a57..84493d89 100644 --- a/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlers.Session.cs +++ b/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlers.Session.cs @@ -157,10 +157,15 @@ public static partial class OpenIddictClientSystemIntegrationHandlers source.SetResult(url); } - else + else if (error is not null) { source.SetException(new NSErrorException(error)); } + + else + { + source.SetException(new InvalidOperationException(SR.GetResourceString(SR.ID0448))); + } }); #if SUPPORTS_PRESENTATION_CONTEXT_PROVIDER