Skip to content

Commit

Permalink
Merge pull request #7 from hashicorp/re-decode-map-value
Browse files Browse the repository at this point in the history
Do not attempt to set unsettable types
  • Loading branch information
mkeeler authored Apr 18, 2019
2 parents be3a5be + 6a1854c commit c4a1f61
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion codec/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ func (f *decFnInfo) kMap(rv reflect.Value) {
}
}
rvv := rv.MapIndex(rvk)
if !rvv.IsValid() {
if !rvv.IsValid() || !rvv.CanSet() {
rvv = reflect.New(vtype).Elem()
}

Expand Down

0 comments on commit c4a1f61

Please sign in to comment.