Only error if requesting a specific array index

This commit is contained in:
Tobie Morgan Hitchcock 2017-12-06 20:19:28 +00:00
parent 84b9cdc93a
commit edcd2d431c

View file

@ -1057,7 +1057,7 @@ func (d *Doc) walk(exec Iterator, prev []string, path ...string) error {
c, i, r := d.what(p, a, choose)
if len(c) == 0 {
if r == one && len(c) == 0 {
return fmt.Errorf("No item with index %s in array, using path %s", p, path)
}