diff --git a/unmarshal.go b/unmarshal.go index dc44635..2c6aa68 100644 --- a/unmarshal.go +++ b/unmarshal.go @@ -552,12 +552,12 @@ func unmarshal(e interface{}, in []byte) (n int, err error) { var key string t := reflect.TypeOf(e) v := reflect.ValueOf(e) - if t.Kind() != reflect.Ptr || v.IsNil() { + if !v.IsValid() || t.Kind() != reflect.Ptr || v.IsNil() { return 0, errors.New("ssob: Need a pointer that is fully allocated for unmarshalling") } p := reflect.Indirect(v) - if p.Kind() != reflect.Ptr { + if p.Kind() != reflect.Ptr && p.Kind() != reflect.Interface { switch p.Kind() { case reflect.Bool, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint8, reflect.Uint16, reflect.Uint32,