diff --git a/config/asrockrack.go b/config/asrockrack.go index bced5d8..51c995b 100644 --- a/config/asrockrack.go +++ b/config/asrockrack.go @@ -54,6 +54,10 @@ func NewAsrockrackVendorConfigManager(configFormat string, vendorOptions map[str // FindMenu locates an existing asrockrackBiosCfgMenu if one exists in the ConfigData, if not // it creates one and returns a pointer to that. func (cm *asrockrackVendorConfig) FindMenu(menuName string) (m *asrockrackBiosCfgMenu) { + if cm.ConfigData.BiosCfg.Menus == nil { + return + } + for _, m = range cm.ConfigData.BiosCfg.Menus { if m.Name == menuName { return diff --git a/config/dell.go b/config/dell.go index fac5e7d..4bfc882 100644 --- a/config/dell.go +++ b/config/dell.go @@ -53,6 +53,7 @@ func NewDellVendorConfigManager(configFormat string, vendorOptions map[string]st } dell.setSystemConfiguration(vendorOptions["model"], vendorOptions["servicetag"]) + return dell, nil } @@ -114,12 +115,14 @@ func (cm *dellVendorConfig) Marshal() (string, error) { if err != nil { return "", err } + return string(x), nil case "json": x, err := json.Marshal(cm.ConfigData.SystemConfiguration) if err != nil { return "", err } + return string(x), nil default: return "", UnknownConfigFormatError(strings.ToLower(cm.ConfigFormat))