diff options
author | JeffB42 <10328858+JeffB42@users.noreply.github.com> | 2021-04-18 01:10:11 +0300 |
---|---|---|
committer | JeffB42 <10328858+JeffB42@users.noreply.github.com> | 2021-04-18 01:10:11 +0300 |
commit | c0dadcb51baf720acb43289b4fb196428bb9d1e5 (patch) | |
tree | 51673a379e518694304fc39a8411c9ee46699632 | |
parent | d73073e600ec87a9e7191864e574adf7b91eba99 (diff) |
added guard against RawConfirm being nil or empty
-rwxr-xr-x | octoprintApis/system.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/octoprintApis/system.go b/octoprintApis/system.go index 573bcae..97f0024 100755 --- a/octoprintApis/system.go +++ b/octoprintApis/system.go @@ -40,11 +40,11 @@ func (cmd *SystemCommandsRequest) Do(c *Client) (*dataModels.SystemCommandsRespo } func convertRawConfirm(commandDefinition *dataModels.CommandDefinition) { - if commandDefinition == nil || commandDefinition.RawConfirm === nil || len(commandDefinition.RawConfirm) < 1 { + if commandDefinition == nil || commandDefinition.RawConfirm == nil || len(commandDefinition.RawConfirm) < 1 { return } - err = json.Unmarshal(commandDefinition.RawConfirm, &commandDefinition.Confirm) + err := json.Unmarshal(commandDefinition.RawConfirm, &commandDefinition.Confirm) if err != nil { logger.LogError("SystemCommandsRequest.convertRawConfirm()", "json.Unmarshal(Custom)", err) commandDefinition.Confirm = "" |