Fix null pointer excpetion bug (#407)

The factory method passes a null trustedCertificates instead of an empty
list.
This commit is contained in:
Lai Jiang 2019-12-12 13:06:43 -05:00 committed by GitHub
parent 6569c1e0cd
commit 21f14681e1

View file

@ -106,7 +106,7 @@ public class SslClientInitializer<C extends Channel> extends ChannelInitializer<
SslContextBuilder.forClient()
.sslProvider(sslProvider)
.trustManager(
trustedCertificates.isEmpty()
trustedCertificates == null || trustedCertificates.isEmpty()
? null
: trustedCertificates.toArray(new X509Certificate[0]));