From 27b67e981e5fe82820ebc3b413107c559ae0a4bd Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Wed, 21 May 2014 20:02:15 +0900 Subject: [PATCH] Fix NPE in OpenSslEngine --- .../src/main/java/io/netty/handler/ssl/OpenSslEngine.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java b/handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java index 677df6c9d2..a753c0ba6b 100644 --- a/handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java +++ b/handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java @@ -808,7 +808,11 @@ public final class OpenSslEngine extends SSLEngine { if (applicationProtocol == null) { applicationProtocol = fallbackApplicationProtocol; } - this.applicationProtocol = applicationProtocol.replace(':', '_'); + if (applicationProtocol != null) { + this.applicationProtocol = applicationProtocol.replace(':', '_'); + } else { + this.applicationProtocol = null; + } return FINISHED; }