add null checks in SslContextFactory for _factory, which could be null if reload failed

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
Lachlan Roberts 2020-07-15 15:35:22 +10:00
parent 2541f1f648
commit c40ba69222
1 changed files with 9 additions and 0 deletions

View File

@ -1131,6 +1131,9 @@ public class SslContextFactory extends AbstractLifeCycle implements Dumpable
synchronized (this)
{
if (_factory == null)
throw new IllegalStateException("reload failed SslContext unavailable");
return _factory._context;
}
}
@ -1532,6 +1535,9 @@ public class SslContextFactory extends AbstractLifeCycle implements Dumpable
synchronized (this)
{
if (_factory == null)
throw new IllegalStateException("reload failed KeyStore unavailable");
return _factory._keyStore;
}
}
@ -1553,6 +1559,9 @@ public class SslContextFactory extends AbstractLifeCycle implements Dumpable
synchronized (this)
{
if (_factory == null)
throw new IllegalStateException("reload failed TrustStore unavailable");
return _factory._trustStore;
}
}