From 30d6b11cef2c221d01e9ff00886b1b0287577aaa Mon Sep 17 00:00:00 2001 From: "James W. Brinkerhoff" Date: Fri, 12 Apr 2024 14:19:36 -0400 Subject: [PATCH] Decuddle some returns --- config/asrockrack.go | 4 ++++ config/dell.go | 2 ++ 2 files changed, 6 insertions(+) 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..7526fb0 100644 --- a/config/dell.go +++ b/config/dell.go @@ -114,12 +114,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))