diff --git a/internal/convertor/device/serializer.go b/internal/convertor/device/serializer.go index 46d2cef..64592b8 100644 --- a/internal/convertor/device/serializer.go +++ b/internal/convertor/device/serializer.go @@ -88,6 +88,10 @@ func (s *SafeRepository) GetDeviceOpenConfigJSON(hostname string) ([]byte, error defer s.mutex.Unlock() if dev, ok := s.devices[hostname]; ok { + if dev == nil { + return []byte(emptyJSON), errors.New("build failed for this device") + } + var config json.RawMessage var err error out := bytes.NewBuffer(nil)