aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/mitchellh/mapstructure/mapstructure.go
diff options
context:
space:
mode:
authorNiall Sheridan <nsheridan@gmail.com>2016-07-17 17:16:14 +0100
committerNiall Sheridan <nsheridan@gmail.com>2016-07-17 18:24:20 +0100
commitc9849d667ab55c23d343332a11afb3eb8ede3f2d (patch)
tree86684d5481d8b12be84ea1a3a8f32afaac007efa /vendor/github.com/mitchellh/mapstructure/mapstructure.go
parent49f40a952943f26494d6407dc608b50b2ec0df7f (diff)
Update vendor libs
Diffstat (limited to 'vendor/github.com/mitchellh/mapstructure/mapstructure.go')
-rw-r--r--vendor/github.com/mitchellh/mapstructure/mapstructure.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/vendor/github.com/mitchellh/mapstructure/mapstructure.go b/vendor/github.com/mitchellh/mapstructure/mapstructure.go
index a367a95..4490521 100644
--- a/vendor/github.com/mitchellh/mapstructure/mapstructure.go
+++ b/vendor/github.com/mitchellh/mapstructure/mapstructure.go
@@ -246,6 +246,10 @@ func (d *Decoder) decode(name string, data interface{}, val reflect.Value) error
// value to "data" of that type.
func (d *Decoder) decodeBasic(name string, data interface{}, val reflect.Value) error {
dataVal := reflect.ValueOf(data)
+ if !dataVal.IsValid() {
+ dataVal = reflect.Zero(val.Type())
+ }
+
dataValType := dataVal.Type()
if !dataValType.AssignableTo(val.Type()) {
return fmt.Errorf(