From 8fb8908883ea1d6a1400a38fc66048625793de2e Mon Sep 17 00:00:00 2001 From: David Allen Date: Wed, 25 Jun 2025 15:34:45 -0600 Subject: [PATCH] fix: added another check for power --- pkg/crawler/main.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkg/crawler/main.go b/pkg/crawler/main.go index f0e09b6..887bf84 100644 --- a/pkg/crawler/main.go +++ b/pkg/crawler/main.go @@ -294,12 +294,13 @@ func walkSystems(rf_systems []*redfish.ComputerSystem, rf_chassis *redfish.Chass if err != nil { log.Warn().Err(err).Str("id", rf_computersystem.ID). Str("system", rf_computersystem.Name).Msg("failed to get power-related details from chassis") - } - - // extract the power control odata.id resource - powercontrolIDs := []string{} - for _, rf_powercontrol := range power.PowerControl { - powercontrolIDs = append(powercontrolIDs, rf_powercontrol.ODataID) + } else { + // extract the power control odata.id resource + if power != nil { + for _, rf_powercontrol := range power.PowerControl { + powercontrolIDs = append(powercontrolIDs, rf_powercontrol.ODataID) + } + } } }