Skip to content

Commit

Permalink
Fix nil pointer exception
Browse files Browse the repository at this point in the history
  • Loading branch information
tr4cks committed Aug 6, 2023
1 parent 9a7f28c commit 4fffc59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/ilo/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (m *IloModule) Init(config map[string]interface{}) error {
func (m *IloModule) State() (modules.Result[bool], modules.Result[bool]) {
powerStateTask, powerStateChan := modules.MakeAsync(func() modules.Result[bool] {
value, err := m.Client.PowerState()
return modules.Result[bool]{*value == PowerStateOn, err}
return modules.Result[bool]{err == nil && *value == PowerStateOn, err}
})

pingTask, pingChan := modules.MakeAsync(func() modules.Result[bool] {
Expand Down

0 comments on commit 4fffc59

Please sign in to comment.