Skip to content

Commit 613a8c0

Browse files
committed
Fix NRE in TransportRequestState when trace is enabled
1 parent 43ca446 commit 613a8c0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ public TransportRequestState(
102102
string path)
103103
{
104104
this._requestId = TransportRequestState.RequestId;
105+
this.Method = method;
106+
this.Path = path;
105107
this.StartedOn = DateTime.UtcNow;
106108
this.SeenNodes = new List<Uri>();
107109
this.SeenExceptions = new List<Exception>();
@@ -116,13 +118,11 @@ public TransportRequestState(
116118
{
117119
Trace.TraceInformation("NEST start:{0} {1} {2}"
118120
, this._requestId
119-
, _result.RequestMethod
120-
, _result.RequestUrl
121+
, this.Method
122+
, this.Path
121123
);
122124
}
123125

124-
this.Method = method;
125-
this.Path = path;
126126
if (this.RequestParameters != null)
127127
{
128128
if (this.RequestParameters.QueryString != null)

0 commit comments

Comments
 (0)