This commit is contained in:
glax 2024-01-20 20:04:10 +01:00
parent 076b6fc271
commit 9bcfd75aa2

View File

@ -41,9 +41,9 @@ public abstract class SerialShocker : Shocker
string regEnum = CUR_CTRL + "Enum\\" + deviceID + "\\Device Parameters";
string? portName = Registry.GetValue(regEnum, "PortName", "")?.ToString();
int s32_Pos = caption.IndexOf(" (COM");
if (s32_Pos > 0) // remove COM port from description
caption = caption.Substring(0, s32_Pos);
int? s32Pos = caption?.IndexOf(" (COM");
if (s32Pos > 0) // remove COM port from description
caption = caption?.Substring(0, (int)s32Pos);
ret.Add(new SerialPortInfo(
portName,