File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
src/ResourceManager/Profile/Commands.Profile Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,10 @@ public override void ExecuteCmdlet()
80
80
}
81
81
}
82
82
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 (
84
87
"Enabled" ,
85
88
StringComparison . OrdinalIgnoreCase ) )
86
89
{
Original file line number Diff line number Diff line change @@ -58,7 +58,10 @@ public override void ExecuteCmdlet()
58
58
throw new ArgumentException ( Resources . AzureProfileMustNotBeNull ) ;
59
59
}
60
60
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 (
62
65
"Enabled" ,
63
66
StringComparison . OrdinalIgnoreCase ) )
64
67
{
You can’t perform that action at this time.
0 commit comments