mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-25 14:52:17 +00:00
fix invalid memory address or nil pointer dereference
This commit is contained in:
parent
60a1f49a5c
commit
6c1572c9b8
@ -146,9 +146,8 @@ func unmarshalResponseBytes(responseBytes []byte, result interface{}) (interface
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Errorf("Error unmarshalling rpc response: %v", err)
|
return nil, errors.Errorf("Error unmarshalling rpc response: %v", err)
|
||||||
}
|
}
|
||||||
errorStr := response.Error.Message
|
if response.Error != nil && response.Error.Message != "" {
|
||||||
if errorStr != "" {
|
return nil, errors.Errorf("Response error: %v", response.Error.Message)
|
||||||
return nil, errors.Errorf("Response error: %v", errorStr)
|
|
||||||
}
|
}
|
||||||
// unmarshal the RawMessage into the result
|
// unmarshal the RawMessage into the result
|
||||||
err = json.Unmarshal(*response.Result, result)
|
err = json.Unmarshal(*response.Result, result)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user