Skip to content

Commit 8dda7e1

Browse files
committed
Fixed null ref exception in MockClientFactory.CreateClient method
1 parent ea109dc commit 8dda7e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Common/Commands.Common.Test/Mocks/MockClientFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public TClient CreateClient<TClient>(AzureProfile profile, AzureEnvironment.Endp
6060

6161
public TClient CreateClient<TClient>(AzureProfile profile, AzureSubscription subscription, AzureEnvironment.Endpoint endpoint) where TClient : ServiceClient<TClient>
6262
{
63-
SubscriptionCloudCredentials creds = new TokenCloudCredentials(subscription.Id.ToString(), "fake_token");
63+
SubscriptionCloudCredentials creds = new TokenCloudCredentials(subscription == null ? "fake_subscription" : subscription.Id.ToString(), "fake_token");
6464
if (HttpMockServer.GetCurrentMode() != HttpRecorderMode.Playback)
6565
{
6666
ProfileClient profileClient = new ProfileClient(

0 commit comments

Comments
 (0)