Skip to content

Commit e39a82f

Browse files
author
Leandro Wajswajn Pereyra
committed
Reverted changes made to this file
1 parent 1595b3a commit e39a82f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/KeyVault/KeyVault/Models/TagsHelper.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ public static Dictionary<string, string> ConvertToDictionary(this Hashtable tags
3131
if (string.IsNullOrWhiteSpace(key))
3232
throw new ArgumentException("Invalid tag name");
3333

34-
string value = (tag.Value == null) ? string.Empty : tag.Value.ToString();
34+
if (tag.Value != null && !(tag.Value is string))
35+
throw new ArgumentException("Tag has invalid value");
36+
string value = (tag.Value == null) ? string.Empty : (string)tag.Value;
3537
tagsDictionary[key] = value;
3638
}
3739

0 commit comments

Comments
 (0)