Permalink
Browse files

fixed ability to limit query by one which does not makes sense

  • Loading branch information...
1 parent ac87cbc commit b221c42f997f750eae26a2aeb9ef8392bcda07c8 @musketyr musketyr committed Nov 21, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 core/src/main/groovyx/gaelyk/query/QueryBuilder.groovy
@@ -557,7 +557,7 @@ class QueryBuilder {
* @param maxPage maximum (or default) limit
*/
QueryBuilder paginate(Map params, int maxPage = 100) {
- if (params.limit) {
+ if (params.limit && (params.limit as int) > 0) {
int theLimit = Math.min(params.limit as int, maxPage)
limit theLimit
chunkSize theLimit
@@ -573,4 +573,4 @@ class QueryBuilder {
this
}
-}
+}

0 comments on commit b221c42

Please sign in to comment.