Fix unhandled NetworkInformationException in UpdateNetworkInterfaces (#2308)

This commit is contained in:
Howon Lee
2026-04-14 16:25:44 +02:00
committed by GitHub
parent c0ee111659
commit 44c1ceb864
@@ -92,9 +92,16 @@ internal class NetworkGroup : IGroup, IHardwareChanged
{ {
if (hardware.All(x => x.NetworkInterface.Id != networkInterface.Id)) if (hardware.All(x => x.NetworkInterface.Id != networkInterface.Id))
{ {
Network network = new(networkInterface, settings); try
hardware.Add(network); {
additions.Add(network); Network network = new(networkInterface, settings);
hardware.Add(network);
additions.Add(network);
}
catch (NetworkInformationException)
{
// Interface became unavailable between enumeration and construction; skip it.
}
} }
} }