Skip to content

Commit a1cc424

Browse files
committed
Handle nil properites
1 parent c5a5106 commit a1cc424

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

internal/arduino/libraries/libraries.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,10 @@ func (library *Library) MarshalBinary(out io.Writer, prefix *paths.Path) error {
127127
return nil
128128
}
129129
writeProperties := func(in *properties.Map) error {
130-
keys := in.Keys()
130+
var keys []string
131+
if in != nil {
132+
keys = in.Keys()
133+
}
131134
if err := binary.Write(out, binary.NativeEndian, uint16(len(keys))); err != nil {
132135
return err
133136
}

0 commit comments

Comments
 (0)