From 9702f336ccc46e0eb0759596c6462963d9f6548d Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Mon, 1 Jul 2013 07:49:50 +1000 Subject: Make sure you never try to take a negative number of things! --- src/clojure_sql/dsl.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/clojure_sql') diff --git a/src/clojure_sql/dsl.clj b/src/clojure_sql/dsl.clj index 6d9b413..6ba81bc 100644 --- a/src/clojure_sql/dsl.clj +++ b/src/clojure_sql/dsl.clj @@ -371,7 +371,7 @@ (-> query (take 10) (drop 2)) = (-> query (drop 2) (take 8))" [query n] (let [query (if-let [old-take (:take query)] - (assoc query :take (- old-take n)) + (assoc query :take (max (- old-take n) 0)) query)] (if-let [old-drop (:drop query)] (assoc query :drop (+ old-drop n)) -- cgit v1.2.3