Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Z-Bolt/OctoScreen.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffB42 <10328858+JeffB42@users.noreply.github.com>2021-04-18 01:10:11 +0300
committerJeffB42 <10328858+JeffB42@users.noreply.github.com>2021-04-18 01:10:11 +0300
commitc0dadcb51baf720acb43289b4fb196428bb9d1e5 (patch)
tree51673a379e518694304fc39a8411c9ee46699632
parentd73073e600ec87a9e7191864e574adf7b91eba99 (diff)
added guard against RawConfirm being nil or empty
-rwxr-xr-xoctoprintApis/system.go4
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 = ""