From d36cecd5561ee7bfaa25c36729d6920614d02af2 Mon Sep 17 00:00:00 2001 From: Oleksandr Poliakov Date: Thu, 11 Apr 2024 14:13:03 -0700 Subject: [PATCH] Fix NullReferenceException in no-auth tests --- tests/MongoDB.Driver.TestHelpers/DriverTestConfiguration.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/MongoDB.Driver.TestHelpers/DriverTestConfiguration.cs b/tests/MongoDB.Driver.TestHelpers/DriverTestConfiguration.cs index e543171489f..8baf5fd6200 100644 --- a/tests/MongoDB.Driver.TestHelpers/DriverTestConfiguration.cs +++ b/tests/MongoDB.Driver.TestHelpers/DriverTestConfiguration.cs @@ -162,7 +162,7 @@ public static MongoClient CreateClient( clientSettings.ServerApi = CoreTestConfiguration.ServerApi; clientSettingsConfigurator?.Invoke(clientSettings); - if (clientSettings.Credential.Mechanism == MongoOidcAuthenticator.MechanismName) + if (clientSettings.Credential?.Mechanism == MongoOidcAuthenticator.MechanismName) { OidcCallbackAdapterCachingFactory.Instance.Reset(); }