From dd4763c7260c53f513b6981fec1b90174038686e Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Thu, 23 Oct 2014 10:18:56 -0500 Subject: [PATCH] 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. --- jsonresults.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsonresults.go b/jsonresults.go index 71a6418f..7ee0704a 100644 --- a/jsonresults.go +++ b/jsonresults.go @@ -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