Skip to content

Commit 08dc121

Browse files
authored
Merge pull request #3921 from Imat00/bug/importer-rework-FortiManager-Autodiscovery
fix/importer-rework forti manager autodiscovery #3448
2 parents 6e20955 + eeb9b3e commit 08dc121

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

roles/ui/files/FWO.UI/Shared/AutoDiscovery.razor

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -624,8 +624,9 @@
624624
{
625625
return;
626626
}
627-
Management mgmtToIgnore = managementsToDisplay[managementsToDisplay.FindIndex(x => x.Id == discoveredDevice.Management.Id)];
628-
if(mgmtToIgnore.Devices.FirstOrDefault(y => y.Relevant == true) == null)
627+
int index = managementsToDisplay.FindIndex(x => x.Id == discoveredDevice.Management.Id);
628+
Management? mgmtToIgnore = index >= 0 ? managementsToDisplay[index] : null;
629+
if (mgmtToIgnore != null && mgmtToIgnore.Devices.FirstOrDefault(y => y.Relevant == true) == null)
629630
{
630631
managementsToDisplay.Remove(mgmtToIgnore);
631632
if(managementsToDisplay.Count == 0)

0 commit comments

Comments
 (0)