Skip to content

Commit b653288

Browse files
committed
Validate input in QueryBuilder.
1 parent 6e62009 commit b653288

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

httprpc-client/src/main/java/org/httprpc/sql/QueryBuilder.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,10 @@ public QueryBuilder orderBy(String... columns) {
293293
* The {@link QueryBuilder} instance.
294294
*/
295295
public QueryBuilder limit(int count) {
296+
if (count < 0) {
297+
throw new IllegalArgumentException();
298+
}
299+
296300
sqlBuilder.append(" limit ");
297301
sqlBuilder.append(count);
298302

0 commit comments

Comments
 (0)