Skip to content

Commit

Permalink
Merge pull request #69 from ninghejun/patch-1
Browse files Browse the repository at this point in the history
fix the bug reflect on zero Value
  • Loading branch information
thoas authored Nov 24, 2019
2 parents 35b4b47 + 1aa708f commit 3108806
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion retrieve.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ func get(value reflect.Value, path string) reflect.Value {
var resultSlice reflect.Value

length := value.Len()


if length == 0 {
return resultSlice
}

for i := 0; i < length; i++ {
item := value.Index(i)

Expand Down

0 comments on commit 3108806

Please sign in to comment.