From 80e6eb4a0ffe2815a1694aef5995e027d15ff537 Mon Sep 17 00:00:00 2001 From: guns Date: Sun, 9 Feb 2014 17:57:30 -0600 Subject: [PATCH] Access opts with `get`, as the map may be nil For instance, this form from the test results in a NPE: (string-pattern ["bat" "bar" "baz"] nil) --- src/cljx/frak.cljx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cljx/frak.cljx b/src/cljx/frak.cljx index 6989efc..0e255cc 100644 --- a/src/cljx/frak.cljx +++ b/src/cljx/frak.cljx @@ -192,11 +192,11 @@ ([strs opts] (let [#+cljs opts #+cljs (js->clj opts) pattern (binding [*capture* (or (:capture? opts) - (opts "capture?"))] + (get opts "capture?"))] (-> (build-trie strs) render-trie remove-unecessary-grouping))] - (if (or (:exact? opts) (opts "exact?")) + (if (or (:exact? opts) (get opts "exact?")) (str "^" pattern "$") pattern)))) -- 2.25.1