Skip to content

Commit 6637b20

Browse files
author
dragonfly91
committed
Using nullOrEmpty check for policyId instead of just the null check
1 parent 4654389 commit 6637b20

File tree

1 file changed

+3
-3
lines changed
  • src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Helpers/Conversions

1 file changed

+3
-3
lines changed

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Helpers/Conversions/ConversionHelpers.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,11 @@ public static AzureRmRecoveryServicesBackupItemBase GetItemModel(ProtectedItemRe
189189
{
190190
string policyName = null;
191191
string policyId = ((AzureIaaSVMProtectedItem)protectedItem.Properties).PolicyId;
192-
if (policyId != null)
192+
if (!string.IsNullOrEmpty(policyId))
193193
{
194-
Dictionary<UriEnums, string> keyVauleDict =
194+
Dictionary<UriEnums, string> keyValueDict =
195195
HelperUtils.ParseUri(policyId);
196-
policyName = HelperUtils.GetPolicyNameFromPolicyId(keyVauleDict, policyId);
196+
policyName = HelperUtils.GetPolicyNameFromPolicyId(keyValueDict, policyId);
197197
}
198198
itemModel = new AzureRmRecoveryServicesBackupIaasVmItem(protectedItem, container, policyName);
199199
}

0 commit comments

Comments
 (0)