Skip to content

Commit 5377f62

Browse files
author
Hao Chen
committed
minor change.
1 parent 0faf789 commit 5377f62

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/ResourceManager/Profile/Commands.Profile/Models/RMProfileClient.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,9 @@ public AzureRMProfile Login(
121121
newTenant == null &&
122122
TryGetTenantSubscription(token, account, environment, tenant, subscriptionId, subscriptionName, out tempSubscription, out tempTenant))
123123
{
124-
if (tempSubscription == null && i + 1 < tenants.Count())
125-
{
126-
// No subscription found for the given token/tenant.
127-
// Discard tempTenant value unless current token/tenant is the last one.
128-
}
129-
else
124+
// If no subscription found for the given token/tenant
125+
// discard tempTenant value unless current token/tenant is the last one.
126+
if (tempSubscription != null || i == (tenants.Count() -1))
130127
{
131128
newTenant = tempTenant;
132129
newSubscription = tempSubscription;

0 commit comments

Comments
 (0)