Skip to content

Commit 5ea9468

Browse files
committed
fix(be): empty Limit param overrides null of params.Limit
1 parent 5bae4d3 commit 5ea9468

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

db/Task.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,15 @@ func (task *Task) PreInsert(gorp.SqlExecutor) error {
9999
task.Params = make(MapStringAnyField)
100100
}
101101

102-
limits := strings.Split(task.Limit, ",")
102+
if task.Limit != "" {
103+
limits := strings.Split(task.Limit, ",")
103104

104-
for i := range limits {
105-
limits[i] = strings.TrimSpace(limits[i])
106-
}
105+
for i := range limits {
106+
limits[i] = strings.TrimSpace(limits[i])
107+
}
107108

108-
task.Params["limit"] = limits
109+
task.Params["limit"] = limits
110+
}
109111
}
110112

111113
return nil

0 commit comments

Comments
 (0)