Skip to content

Commit

Permalink
check existence of js/window to avoid undefined access
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles Loomis authored and oliyh committed Oct 27, 2019
1 parent 2d058f1 commit 7c3f80c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/re_graph/internals.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@

(defn default-ws-url []
#?(:cljs
(when (exists? (.-location js/window))
(when (and (exists? js/window) (exists? (.-location js/window)))
(let [host-and-port (.-host js/window.location)
ssl? (re-find #"^https" (.-origin js/window.location))]
(str (if ssl? "wss" "ws") "://" host-and-port "/graphql-ws")))
Expand Down

0 comments on commit 7c3f80c

Please sign in to comment.