Skip to content

Commit

Permalink
Extra nil check added for copyBlank
Browse files Browse the repository at this point in the history
  • Loading branch information
markdicksonjr committed Feb 29, 2020
1 parent 27aef62 commit c912ebd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/markdicksonjr/config
go 1.12

require (
github.com/markdicksonjr/dot v0.8.0
github.com/markdicksonjr/dot v0.8.2
github.com/stretchr/testify v1.4.0 // indirect
gopkg.in/yaml.v2 v2.2.2
)
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/markdicksonjr/dot v0.8.0 h1:tf9/zUpl17duOukWjOGPALwjWpLwNynU0OKAfnlRf7Y=
github.com/markdicksonjr/dot v0.8.0/go.mod h1:56w2FRih96QqJky5Wu1dn5bJcJKEaq5HSOo//x+y1rw=
github.com/markdicksonjr/dot v0.8.1 h1:xHIKMhF3rWUWqiZjWN6jPsgOBKJKZOALGSeDWBY3QnA=
github.com/markdicksonjr/dot v0.8.1/go.mod h1:56w2FRih96QqJky5Wu1dn5bJcJKEaq5HSOo//x+y1rw=
github.com/markdicksonjr/dot v0.8.2 h1:qB8X1KyjiV9gmwKHbE0DaNxbXtQjdIRu20d96mGOeAE=
github.com/markdicksonjr/dot v0.8.2/go.mod h1:56w2FRih96QqJky5Wu1dn5bJcJKEaq5HSOo//x+y1rw=
github.com/oleiade/reflections v1.0.0 h1:0ir4pc6v8/PJ0yw5AEtMddfXpWBXg9cnG7SgSoJuCgY=
github.com/oleiade/reflections v1.0.0/go.mod h1:RbATFBbKYkVdqmSFtx13Bb/tVhR0lgOBXunWTZKeL4w=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand Down
3 changes: 3 additions & 0 deletions lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ func blankCopy(val interface{}) (map[string]interface{}, error) {
recursiveLeavesKeys := dot.KeysRecursiveLeaves(val)
for _, key := range recursiveLeavesKeys {
dotVal, _ := dot.Get(val, key)
if dotVal == nil {
continue
}
dotType := reflect.TypeOf(dotVal)

if dotType.Kind() == reflect.Ptr {
Expand Down

0 comments on commit c912ebd

Please sign in to comment.