Skip to content

Commit

Permalink
Fix access error when subscripiton has no Tags property (#277)
Browse files Browse the repository at this point in the history
  • Loading branch information
msJinLei authored Jul 13, 2021
1 parent b117855 commit 92c73a2
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ public static void SetSubscriptionPolicies(this IAzureSubscription subscription,
/// <returns>The tags of the subscription</returns>
public static Dictionary<string,string> GetTags(this IAzureSubscription subscription)
{
return JsonConvert.DeserializeObject<Dictionary<string,string>>(subscription.GetProperty(AzureSubscription.Property.Tags));
var tags = subscription.GetProperty(AzureSubscription.Property.Tags);
return string.IsNullOrEmpty(tags) ? null : JsonConvert.DeserializeObject<Dictionary<string,string>>(tags);
}

/// <summary>
Expand Down

0 comments on commit 92c73a2

Please sign in to comment.