Skip to content

Commit c026b1c

Browse files
committed
[dev] add check for empty field
1 parent c049081 commit c026b1c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sql.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func inSQL(field string, data []interface{}) (string, []interface{}, error) {
4040
}
4141

4242
func GetSQL(data Filter, config *SQLConfig) (string, []interface{}, error) {
43-
if data.Kids == nil {
43+
if data.Kids == nil && data.Field != "" {
4444
if config != nil && config.Whitelist != nil && !config.Whitelist[data.Field] {
4545
return "", nil, fmt.Errorf("field name is not in whitelist: %s", data.Field)
4646
}

0 commit comments

Comments
 (0)