From a1cc424543c009f3f38fb4c535c3c62cbe8c5ef4 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Wed, 9 Oct 2024 12:19:44 +0200 Subject: [PATCH] Handle nil properites --- internal/arduino/libraries/libraries.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/arduino/libraries/libraries.go b/internal/arduino/libraries/libraries.go index eb47a2ab84c..025443488c3 100644 --- a/internal/arduino/libraries/libraries.go +++ b/internal/arduino/libraries/libraries.go @@ -127,7 +127,10 @@ func (library *Library) MarshalBinary(out io.Writer, prefix *paths.Path) error { return nil } writeProperties := func(in *properties.Map) error { - keys := in.Keys() + var keys []string + if in != nil { + keys = in.Keys() + } if err := binary.Write(out, binary.NativeEndian, uint16(len(keys))); err != nil { return err }