Merge pull request #923 from MihaelaStoica/CA-205693

CA-205693: Add a check to prevent Index out of range error
This commit is contained in:
Gabor Apati-Nagy 2016-04-04 15:34:41 +01:00
commit 0e42d71bb1
3 changed files with 12 additions and 0 deletions

View File

@ -147,6 +147,10 @@ namespace XenAdmin.Commands
actionsToComplete.Add(getActivateVBDAction(vbd));
}
if (actionsToComplete.Count == 0)
return;
if (actionsToComplete.Count > 1)
RunMultipleActions(actionsToComplete, Messages.ACTION_ACTIVATING_MULTIPLE_VDIS_TITLE, Messages.ACTION_ACTIVATING_MULTIPLE_VDIS_STATUS, Messages.COMPLETED, true);
else

View File

@ -150,6 +150,10 @@ namespace XenAdmin.Commands
actionsToComplete.Add(getDeactivateVBDAction(vbd));
}
if (actionsToComplete.Count == 0)
return;
if (actionsToComplete.Count > 1)
RunMultipleActions(actionsToComplete, Messages.ACTION_ACTIVATING_MULTIPLE_VDIS_TITLE, Messages.ACTION_ACTIVATING_MULTIPLE_VDIS_STATUS, Messages.COMPLETED, true);
else

View File

@ -454,6 +454,10 @@ namespace XenAdmin.Commands
actionsToComplete.AddRange(getDestroyVDIAction(vdi, deletedVMSnapshots));
}
if (actionsToComplete.Count == 0)
return;
if (actionsToComplete.Count > 1)
RunMultipleActions(actionsToComplete, Messages.ACTION_DELETING_MULTIPLE_STORAGE_ITEMS_TITLE, Messages.ACTION_DELETING_MULTIPLE_STORAGE_ITEMS_STATUS, Messages.COMPLETED, true);
else