Skip to content

Commit e2712ba

Browse files
author
Hovsep Mkrtchyan
committed
Fixed test failures
1 parent e453f3c commit e2712ba

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/ResourceManager/Profile/Commands.Profile/Context/SetAzureRMContext.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ public override void ExecuteCmdlet()
8080
}
8181
}
8282

83-
if (!AzureRmProfileProvider.Instance.Profile.Context.Subscription.State.Equals(
83+
if (AzureRmProfileProvider.Instance.Profile.Context != null &&
84+
AzureRmProfileProvider.Instance.Profile.Context.Subscription != null &&
85+
AzureRmProfileProvider.Instance.Profile.Context.Subscription.State != null &&
86+
!AzureRmProfileProvider.Instance.Profile.Context.Subscription.State.Equals(
8487
"Enabled",
8588
StringComparison.OrdinalIgnoreCase))
8689
{

src/ResourceManager/Profile/Commands.Profile/Profile/SelectAzureRMProfile.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ public override void ExecuteCmdlet()
5858
throw new ArgumentException(Resources.AzureProfileMustNotBeNull);
5959
}
6060

61-
if (!AzureRmProfileProvider.Instance.Profile.Context.Subscription.State.Equals(
61+
if (AzureRmProfileProvider.Instance.Profile.Context != null &&
62+
AzureRmProfileProvider.Instance.Profile.Context.Subscription != null &&
63+
AzureRmProfileProvider.Instance.Profile.Context.Subscription.State != null &&
64+
!AzureRmProfileProvider.Instance.Profile.Context.Subscription.State.Equals(
6265
"Enabled",
6366
StringComparison.OrdinalIgnoreCase))
6467
{

0 commit comments

Comments
 (0)