mirror of https://github.com/apache/lucene.git
SOLR-9877: Add a null check for target
This commit is contained in:
parent
e5264c4895
commit
3eab1b4839
|
@ -78,7 +78,9 @@ public class InstrumentedHttpRequestExecutor extends HttpRequestExecutor impleme
|
|||
String schemeHostPort = null;
|
||||
if (request instanceof HttpRequestWrapper) {
|
||||
HttpRequestWrapper wrapper = (HttpRequestWrapper) request;
|
||||
schemeHostPort = wrapper.getTarget().getSchemeName() + "://" + wrapper.getTarget().getHostName() + ":" + wrapper.getTarget().getPort();
|
||||
if (wrapper.getTarget() != null) {
|
||||
schemeHostPort = wrapper.getTarget().getSchemeName() + "://" + wrapper.getTarget().getHostName() + ":" + wrapper.getTarget().getPort();
|
||||
}
|
||||
}
|
||||
final URIBuilder url = new URIBuilder(requestLine.getUri());
|
||||
return SolrMetricManager.mkName((schemeHostPort != null ? schemeHostPort : "") + url.removeQuery().build().toString() + "." + methodNameString(request), scope);
|
||||
|
|
Loading…
Reference in New Issue