mirror of
https://github.com/go-micro/go-micro.git
synced 2025-01-11 17:18:28 +02:00
Fixes nil pointer dereference error
Cannot unmarshal into nil struct
This commit is contained in:
parent
4a4bdcb83b
commit
35fd6796b1
@ -27,8 +27,8 @@ func New(id, detail string, code int32) error {
|
||||
}
|
||||
|
||||
func Parse(err string) *Error {
|
||||
var e *Error
|
||||
errr := json.Unmarshal([]byte(err), &e)
|
||||
e := new(Error)
|
||||
errr := json.Unmarshal([]byte(err), e)
|
||||
if errr != nil {
|
||||
e.Detail = err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user