Skip to content

Commit

Permalink
Merge pull request #28 from kpetremann/panic_not_built_device
Browse files Browse the repository at this point in the history
fix: panic when user requests non built config
  • Loading branch information
kpetremann authored Jan 11, 2024
2 parents 7c52799 + 639abda commit db05db1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/convertor/device/serializer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit db05db1

Please sign in to comment.