From f1ef20747cde120e27131b3915233c750071663c Mon Sep 17 00:00:00 2001 From: "David R. Williamson" Date: Mon, 3 Jan 2022 13:58:36 -0800 Subject: [PATCH] fix(iot-svc): update debug assert --- iothub/device/src/IotHubConnectionString.Core.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iothub/device/src/IotHubConnectionString.Core.cs b/iothub/device/src/IotHubConnectionString.Core.cs index 70edd63dd0..c9a59917e4 100644 --- a/iothub/device/src/IotHubConnectionString.Core.cs +++ b/iothub/device/src/IotHubConnectionString.Core.cs @@ -19,11 +19,11 @@ Task IAuthorizationProvider.GetPasswordAsync() if (Logging.IsEnabled) Logging.Enter(this, $"{nameof(IotHubConnectionString)}.{nameof(IAuthorizationProvider.GetPasswordAsync)}"); - Debug.Assert(TokenRefresher != null); + Debug.Assert(!string.IsNullOrWhiteSpace(SharedAccessSignature) || TokenRefresher != null, "Both can't be null"); return !string.IsNullOrWhiteSpace(SharedAccessSignature) ? Task.FromResult(SharedAccessSignature) - : TokenRefresher.GetTokenAsync(Audience); + : TokenRefresher?.GetTokenAsync(Audience); } finally {