go-serial
go-serial copied to clipboard
Enumerator panics on windows when removing a device mid enumeration
panic: runtime error: index out of range [0] with length 0
goroutine 883 [running]:\ngo.bug.st/serial/enumerator.retrievePortDetailsFromDevInfo(0xc00011f3b0, 0xc000121560, 0x5, 0x0)
/go/pkg/mod/go.bug.st/[email protected]/enumerator/usb_windows.go:351 +0x365
go.bug.st/serial/enumerator.nativeGetDetailedPortsList(0x0, 0x0, 0x0, 0x0, 0x0)
/go/pkg/mod/go.bug.st/[email protected]/enumerator/usb_windows.go:299 +0x1b1
go.bug.st/serial/enumerator.GetDetailedPortsList(...)
/go/pkg/mod/go.bug.st/[email protected]/enumerator/enumerator.go:31
I suspect N needs a zero check on line 350:
