Don't modify nil getnetworkinfo result.
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.
This commit is contained in:
parent
a5b1a31e07
commit
dd4763c726
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue