Skip to content

Commit 3108806

Browse files
authored
Merge pull request #69 from ninghejun/patch-1
fix the bug reflect on zero Value
2 parents 35b4b47 + 1aa708f commit 3108806

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

retrieve.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ func get(value reflect.Value, path string) reflect.Value {
2121
var resultSlice reflect.Value
2222

2323
length := value.Len()
24-
24+
25+
if length == 0 {
26+
return resultSlice
27+
}
28+
2529
for i := 0; i < length; i++ {
2630
item := value.Index(i)
2731

0 commit comments

Comments
 (0)