fix NPE from contextClassLoader in XmlBasedHttpClientProvider

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
Lachlan Roberts 2020-10-01 17:40:37 +10:00
parent 81c88cdde0
commit a91a7630e0
1 changed files with 5 additions and 1 deletions

View File

@ -34,7 +34,11 @@ class XmlBasedHttpClientProvider
public static HttpClient get(@SuppressWarnings("unused") WebSocketContainerScope scope)
{
URL resource = Thread.currentThread().getContextClassLoader().getResource("jetty-websocket-httpclient.xml");
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
if (contextClassLoader == null)
return null;
URL resource = contextClassLoader.getResource("jetty-websocket-httpclient.xml");
if (resource == null)
return null;