diff --git a/Desktop/Application/MaxMix/Services/Communication/Discovery/DiscoveryService.cs b/Desktop/Application/MaxMix/Services/Communication/Discovery/DiscoveryService.cs index cf7ae068..0b310390 100644 --- a/Desktop/Application/MaxMix/Services/Communication/Discovery/DiscoveryService.cs +++ b/Desktop/Application/MaxMix/Services/Communication/Discovery/DiscoveryService.cs @@ -81,11 +81,13 @@ private Task<string> DiscoverAsync() private string Discover() { - var portNames = SerialPort.GetPortNames(); - + string[] portNames; var result = string.Empty; - SerialPort serialPort = null; + try { portNames = SerialPort.GetPortNames(); } + catch { return result; } + + SerialPort serialPort = null; foreach (var portName in portNames) { try