From faa495c3620b247ae74905605c688b53f1567586 Mon Sep 17 00:00:00 2001 From: Justin Kramer Date: Fri, 24 Aug 2012 17:35:49 -0400 Subject: [PATCH] don't allow nil in :offset or :limit --- src/honeysql/helpers.clj | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/honeysql/helpers.clj b/src/honeysql/helpers.clj index c38534d..4aea1b8 100644 --- a/src/honeysql/helpers.clj +++ b/src/honeysql/helpers.clj @@ -123,10 +123,14 @@ (update-in m [:order-by] concat (collify fields))) (defhelper limit [m l] - (assoc m :limit (if (coll? l) (first l) l))) + (if (nil? l) + m + (assoc m :limit (if (coll? l) (first l) l)))) (defhelper offset [m o] - (assoc m :offset (if (coll? o) (first o) o))) + (if (nil? o) + m + (assoc m :offset (if (coll? o) (first o) o)))) (defhelper modifiers [m ms] (assoc m :modifiers (collify ms)))