Add a nil case to the expandWildcards function

Signed-off-by: Sergen Yalçın <yalcinsergen97@gmail.com>
This commit is contained in:
Sergen Yalçın 2023-12-12 13:09:14 +03:00
parent 8d1435650d
commit cac4c15ef3
No known key found for this signature in database
GPG Key ID: 9AE9E8BDB520B045
1 changed files with 2 additions and 0 deletions

View File

@ -204,6 +204,8 @@ func expandWildcards(data any, segments Segments) ([]Segments, error) { //nolint
}
res = append(res, r...)
}
case nil:
return nil, errNotFound{errors.Errorf("%s: value of the field is nil", segments[:i])}
default:
return nil, errors.Errorf("%q: unexpected wildcard usage", segments[:i])
}