Skip to content

Commit b9d62f1

Browse files
authored
Merge pull request #6 from dumim/develop
Panic check added
2 parents a484ec6 + a6786fb commit b9d62f1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

map.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ func getMapOfAllKeyValues(s interface{}) *map[string]interface{} {
9999
for i := 0; i < s.Len(); i++ {
100100
if t.Field(i).CanInterface() {
101101
m := getMapOfAllKeyValues(s.Index(i).Interface()) // get the map value of the object, recursively
102-
sliceOfMap = append(sliceOfMap, *m) // append to the slice
102+
if m != nil {
103+
sliceOfMap = append(sliceOfMap, *m) // append to the slice
104+
}
103105
}
104106
}
105107
finalMap[k] = sliceOfMap

0 commit comments

Comments
 (0)