accounts/abi: allow interface as the destination (#18490)

This commit is contained in:
gary rong
2019-01-23 21:36:49 +08:00
committed by Guillaume Ballet
parent ad849c01d3
commit a50b471b6b
2 changed files with 16 additions and 1 deletions

View File

@ -74,7 +74,7 @@ func mustArrayToByteSlice(value reflect.Value) reflect.Value {
func set(dst, src reflect.Value) error {
dstType, srcType := dst.Type(), src.Type()
switch {
case dstType.Kind() == reflect.Interface:
case dstType.Kind() == reflect.Interface && dst.Elem().IsValid():
return set(dst.Elem(), src)
case dstType.Kind() == reflect.Ptr && dstType.Elem() != derefbigT:
return set(dst.Elem(), src)