protection against potential nil object
This commit is contained in:
parent
c8c6d3080d
commit
1008958854
|
@ -109,7 +109,9 @@
|
||||||
(defn channel-state
|
(defn channel-state
|
||||||
"returns the current state of the browserchannel connection."
|
"returns the current state of the browserchannel connection."
|
||||||
[]
|
[]
|
||||||
(get bch-state-enum-to-keyword (.getState (get-channel)) :unknown))
|
(if-let [channel (get-channel)]
|
||||||
|
(get bch-state-enum-to-keyword (.getState channel) :unknown)
|
||||||
|
:closed))
|
||||||
|
|
||||||
(defn connected?
|
(defn connected?
|
||||||
"returns true if the browserchannel connection is currently connected."
|
"returns true if the browserchannel connection is currently connected."
|
||||||
|
|
Reference in a new issue