Skip to content

Commit 28af6e3

Browse files
committed
Guard against NPEs in channel-ssl-session
1 parent d397052 commit 28af6e3

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/aleph/netty.clj

+8-7
Original file line numberDiff line numberDiff line change
@@ -1190,13 +1190,14 @@
11901190
(partial coerce-ssl-context ssl-client-context))
11911191

11921192
(defn ^:no-doc channel-ssl-session [^Channel ch]
1193-
(or (some-> ch
1194-
^ChannelPipeline (.pipeline)
1195-
^SslHandler (.get SslHandler)
1196-
.engine
1197-
.getSession)
1198-
;; Needed for multiplexed child channels (e.g. as present in HTTP/2)
1199-
(recur (.parent ch))))
1193+
(when ch
1194+
(or (some-> ch
1195+
^ChannelPipeline (.pipeline)
1196+
^SslHandler (.get SslHandler)
1197+
.engine
1198+
.getSession)
1199+
;; Needed for multiplexed child channels (e.g. as present in HTTP/2)
1200+
(recur (.parent ch)))))
12001201

12011202
(defn ^:no-doc ssl-handshake-error? [^Throwable ex]
12021203
(and (instance? DecoderException ex)

0 commit comments

Comments
 (0)