From 26be209d3a9dfbc98bd31bebd26ce8e54fd46030 Mon Sep 17 00:00:00 2001 From: Tommi Reiman Date: Thu, 14 Jun 2018 17:50:24 +0300 Subject: [PATCH] handle nil with IntoString --- modules/reitit-core/src/reitit/impl.cljc | 7 +++++-- test/cljc/reitit/impl_test.cljc | 6 ++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/reitit-core/src/reitit/impl.cljc b/modules/reitit-core/src/reitit/impl.cljc index 1c654d36..49409265 100644 --- a/modules/reitit-core/src/reitit/impl.cljc +++ b/modules/reitit-core/src/reitit/impl.cljc @@ -196,10 +196,13 @@ #?(:clj Object :cljs object) - (into-string [this] (str this))) + (into-string [this] (str this)) + + nil + (into-string [this])) (defn path-params - "shallow transform of the path-param values into strings" + "shallow transform of the path parameters values into strings" [params] (reduce-kv (fn [m k v] diff --git a/test/cljc/reitit/impl_test.cljc b/test/cljc/reitit/impl_test.cljc index 3e2e5ff5..1f669b83 100644 --- a/test/cljc/reitit/impl_test.cljc +++ b/test/cljc/reitit/impl_test.cljc @@ -33,7 +33,8 @@ :s "kikka" :u "c2541900-17a7-4353-9024-db8ac258ba4e" :k "kikka" - :qk "reitit.impl-test%2Fkikka"} + :qk "reitit.impl-test%2Fkikka" + :nil nil} (impl/path-params {:n 1 :n1 -1 :n2 (long 1) @@ -45,4 +46,5 @@ :s "kikka" :u #uuid "c2541900-17a7-4353-9024-db8ac258ba4e" :k :kikka - :qk ::kikka})))) + :qk ::kikka + :nil nil}))))