Skip to content
This repository has been archived by the owner on Sep 6, 2018. It is now read-only.

Commit

Permalink
Merge pull request #221 from influxdb/check-for-errors
Browse files Browse the repository at this point in the history
check for errors in serialization and deserialization
  • Loading branch information
benbjohnson committed Apr 18, 2014
2 parents 047192e + c6ae3cf commit 0687ff8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion command.go
Expand Up @@ -56,7 +56,9 @@ func newCommand(name string, data []byte) (Command, error) {
return nil, err
}
} else {
json.NewDecoder(bytes.NewReader(data)).Decode(copy)
if err := json.NewDecoder(bytes.NewReader(data)).Decode(copy); err != nil {
return nil, err
}
}
}

Expand Down
4 changes: 3 additions & 1 deletion log_entry.go
Expand Up @@ -29,7 +29,9 @@ func newLogEntry(log *Log, event *ev, index uint64, term uint64, command Command
return nil, err
}
} else {
json.NewEncoder(&buf).Encode(command)
if err := json.NewEncoder(&buf).Encode(command); err != nil {
return nil, err
}
}
}

Expand Down

0 comments on commit 0687ff8

Please sign in to comment.