From d0944cf19cecb68a3f8965ab5c1d3cc8facedd2f Mon Sep 17 00:00:00 2001 From: Konstantina Chremmou Date: Tue, 22 Feb 2022 16:38:59 +0000 Subject: [PATCH] A new row should be added only when it is not found. Signed-off-by: Konstantina Chremmou --- XenAdmin/Wizards/DRWizards/DRFailoverWizardStoragePage.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/XenAdmin/Wizards/DRWizards/DRFailoverWizardStoragePage.cs b/XenAdmin/Wizards/DRWizards/DRFailoverWizardStoragePage.cs index 22864e8f3..49f2c2a4c 100644 --- a/XenAdmin/Wizards/DRWizards/DRFailoverWizardStoragePage.cs +++ b/XenAdmin/Wizards/DRWizards/DRFailoverWizardStoragePage.cs @@ -180,7 +180,7 @@ namespace XenAdmin.Wizards.DRWizards bool poolMetadataDetected = vdis.Any(vdi => vdi.type == vdi_type.metadata); var row = dataGridViewSRs.Rows.Cast().FirstOrDefault(r => r.SrUuid == sr.uuid); - if (row != null) + if (row == null) { row = new SrRow(sr, poolMetadataDetected, SelectedSRsUuids.Contains(sr.uuid)); dataGridViewSRs.Rows.Add(row); @@ -193,7 +193,7 @@ namespace XenAdmin.Wizards.DRWizards foreach (var srInfo in scannedDevice.SRList) { var row = dataGridViewSRs.Rows.Cast().FirstOrDefault(r => r.SrUuid == srInfo.UUID); - if (row != null) + if (row == null) { row = new SrRow(srInfo, scannedDevice.Type, srInfo.PoolMetadataDetected, SelectedSRsUuids.Contains(srInfo.UUID)); @@ -358,7 +358,7 @@ namespace XenAdmin.Wizards.DRWizards { var row = dataGridViewSRs.Rows.Cast().FirstOrDefault(r => r.SrUuid == srInfo.UUID); - if (row != null) + if (row == null) { row = new SrRow(srInfo, type, srInfo.PoolMetadataDetected, srInfo.PoolMetadataDetected); dataGridViewSRs.Rows.Add(row);