Skip to content

Commit a8a998a

Browse files
committed
[fix] missing null guard in SSLSocket#alpn_protocol
1 parent 6ee2a46 commit a8a998a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/main/java/org/jruby/ext/openssl/SSLSocket.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ private SSLEngine ossl_ssl_setup(final ThreadContext context, final boolean serv
244244

245245
@JRubyMethod(name = "alpn_protocol")
246246
public IRubyObject alpn_protocol(final ThreadContext context) {
247+
if ( engine == null ) return context.nil;
247248
final String protocol = engine.getApplicationProtocol();
248249
// null if it has not yet been determined if alpn might be used for this connection,
249250
// an empty String if application protocols values will not be used,

0 commit comments

Comments
 (0)