diff --git a/Source/v2/Meadow.Tooling.Core/Connection/MeadowConnectionManager.cs b/Source/v2/Meadow.Tooling.Core/Connection/MeadowConnectionManager.cs index cf6ba45a..435f5434 100644 --- a/Source/v2/Meadow.Tooling.Core/Connection/MeadowConnectionManager.cs +++ b/Source/v2/Meadow.Tooling.Core/Connection/MeadowConnectionManager.cs @@ -180,7 +180,11 @@ public static async Task> GetMeadowSerialPortsForOsx() if (foundMeadow && line.Contains("IODialinDevice")) { int startIndex = line.IndexOf("/"); + if (startIndex == -1) { continue; } + int endIndex = line.IndexOf("\"", startIndex + 1); + if (endIndex == -1) { continue; } + var port = line.Substring(startIndex, endIndex - startIndex); ports.Add(port);