Skip to content

Commit

Permalink
lookup - check for value has something in it
Browse files Browse the repository at this point in the history
  • Loading branch information
brianvoe committed Mar 27, 2024
1 parent aff3693 commit 163b487
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lookup.go
Expand Up @@ -262,6 +262,11 @@ func (i *Info) GetAny(m *MapParams, field string) (any, error) {
return nil, err
}

// Make sure value[0] exists
if len(value) == 0 {
return nil, fmt.Errorf("could not find field: %s", field)
}

var anyValue any

// Try to convert to int
Expand Down

0 comments on commit 163b487

Please sign in to comment.