fix: do not add nil filters (#3394)

This commit is contained in:
Deluan Quintão
2024-10-15 19:03:16 -04:00
committed by GitHub
parent ae6499b941
commit 16d1314a68
2 changed files with 21 additions and 1 deletions
+3 -1
View File
@@ -29,7 +29,9 @@ func (r *sqlRepository) parseRestFilters(ctx context.Context, options rest.Query
// Look for a custom filter function
f = strings.ToLower(f)
if ff, ok := r.filterMappings[f]; ok {
filters = append(filters, ff(f, v))
if filter := ff(f, v); filter != nil {
filters = append(filters, filter)
}
continue
}
// Ignore invalid filters (not based on a field or filter function)