Fix unhandled NetworkInformationException in UpdateNetworkInterfaces (#2308)
This commit is contained in:
@@ -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.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user