diff --git a/src/honeysql/core.clj b/src/honeysql/core.clj index e62bcac..81dadc8 100644 --- a/src/honeysql/core.clj +++ b/src/honeysql/core.clj @@ -148,10 +148,13 @@ [{} clauses])] (reduce (fn [sql-map [op args]] - (let [handler (handlers op)] + (if-let [handler (handlers op)] (if (or (#{:where :having} op) (not (coll? args))) - (handler sql-map args) - (apply handler sql-map args)))) + (if (nil? args) + sql-map + (handler sql-map args)) + (apply handler sql-map args)) + sql-map)) base (partition 2 clauses))))