Skip to content

Commit 9e14242

Browse files
committed
Fix #1009: diabling metrics caused a NRE in TransportRequestState
1 parent 6341b90 commit 9e14242

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Elasticsearch.Net/Connection/RequestState/TransportRequestState.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public TransportRequestState(
9494
this.RequestParameters = requestParameters;
9595
this._traceEnabled = settings.TraceEnabled;
9696
this._metricsEnabled = settings.MetricsEnabled;
97-
if (this._metricsEnabled)
97+
if (this._metricsEnabled || this._traceEnabled)
9898
this._stopwatch = Stopwatch.StartNew();
9999

100100
this.Method = method;

0 commit comments

Comments
 (0)