From 30535a8c60cda0911de2f63248a1535f2de98042 Mon Sep 17 00:00:00 2001 From: gered Date: Sat, 27 Dec 2014 23:44:33 -0500 Subject: [PATCH] gracefully handle a non-existant anti-forgery meta tag --- src/cljs/clj_browserchannel_messaging/client.cljs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cljs/clj_browserchannel_messaging/client.cljs b/src/cljs/clj_browserchannel_messaging/client.cljs index 215858f..dffabe5 100644 --- a/src/cljs/clj_browserchannel_messaging/client.cljs +++ b/src/cljs/clj_browserchannel_messaging/client.cljs @@ -108,7 +108,8 @@ :on-send (get-handlers middleware :on-send)})) (defn- get-anti-forgery-token [] - (.-content (sel1 "meta[name='anti-forgery-token']"))) + (if-let [tag (sel1 "meta[name='anti-forgery-token']")] + (.-content tag))) (defn init! "Sets up browserchannel for use, creating a handler with the specified