diff options
Diffstat (limited to 'rpc/args.go')
-rw-r--r-- | rpc/args.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/rpc/args.go b/rpc/args.go index d3449928b..b23216c98 100644 --- a/rpc/args.go +++ b/rpc/args.go @@ -388,8 +388,12 @@ func (args *Sha3Args) UnmarshalJSON(b []byte) (err error) { if len(obj) < 1 { return NewInsufficientParamsError(len(obj), 1) } - args.Data = obj[0].(string) + argstr, ok := obj[0].(string) + if !ok { + return NewInvalidTypeError("data", "is not a string") + } + args.Data = argstr return nil } |