Skip to content

Commit 91c7fb3

Browse files
committed
Fixed panic in convertAnsiBytesToString implementation
1 parent cff613f commit 91c7fb3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

internal/arduino/builder/internal/utils/ansi_windows.go

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ import (
2020
)
2121

2222
func convertAnsiBytesToString(data []byte) (string, error) {
23+
if len(data) == 0 {
24+
return "", nil
25+
}
2326
dataSize := int32(len(data))
2427
size, err := windows.MultiByteToWideChar(windows.GetACP(), 0, &data[0], dataSize, nil, 0)
2528
if err != nil {

0 commit comments

Comments
 (0)