diff --git a/src/honey/sql/helpers.cljc b/src/honey/sql/helpers.cljc index 31c06f2..fd6c4b4 100644 --- a/src/honey/sql/helpers.cljc +++ b/src/honey/sql/helpers.cljc @@ -10,14 +10,19 @@ (defn- and-merge [current args] - (cond (= :and (first current)) - (default-merge current args) - (seq current) - (default-merge [:and current] args) - (= 1 (count args)) - (vec (first args)) - :else - (default-merge [:and] args))) + (let [args (remove nil? args)] + (cond (= :and (first current)) + (default-merge current args) + (seq current) + (if (seq args) + (default-merge [:and current] args) + current) + (= 1 (count args)) + (vec (first args)) + (seq args) + (default-merge [:and] args) + :else + (vec current)))) (def ^:private special-merges {:where #'and-merge