Skip to content

Commit ef28efc

Browse files
authored
Fix NullReferenceException in no-auth tests (#1306)
1 parent 6817795 commit ef28efc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/MongoDB.Driver.TestHelpers/DriverTestConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public static MongoClient CreateClient(
162162
clientSettings.ServerApi = CoreTestConfiguration.ServerApi;
163163
clientSettingsConfigurator?.Invoke(clientSettings);
164164

165-
if (clientSettings.Credential.Mechanism == MongoOidcAuthenticator.MechanismName)
165+
if (clientSettings.Credential?.Mechanism == MongoOidcAuthenticator.MechanismName)
166166
{
167167
OidcCallbackAdapterCachingFactory.Instance.Reset();
168168
}

0 commit comments

Comments
 (0)