Skip to content

Commit

Permalink
Don't modify nil getnetworkinfo result.
Browse files Browse the repository at this point in the history
Since the result might not be set when the response does not contain one,
such as in the case when the command is not implemented by the server,
don't attempt to modify it until ensuring it exists.
  • Loading branch information
davecgh committed Oct 23, 2014
1 parent a5b1a31 commit dd4763c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jsonresults.go
Expand Up @@ -580,7 +580,7 @@ func ReadResultCmd(cmd string, message []byte) (Reply, error) {
var res *GetNetworkInfoResult
err = json.Unmarshal(objmap["result"], &res)
if err == nil {
if res.LocalAddresses == nil {
if res != nil && res.LocalAddresses == nil {
res.LocalAddresses = []LocalAddressesResult{}
}
result.Result = res
Expand Down

0 comments on commit dd4763c

Please sign in to comment.