Skip to content

Commit 394d90d

Browse files
committed
fixed nullref causing elasticsearch.net unit tests to fail
1 parent 0ab5078 commit 394d90d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/Elasticsearch.Net/Connection/Transport.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ public IList<Uri> Sniff()
103103
using (response.Response)
104104
{
105105
return Sniffer.FromStream(response, response.Response, this.Serializer);
106-
107106
}
108107
}
109108
}
@@ -138,7 +137,7 @@ private void SniffIfInformationIsTooOld(int retried)
138137
private int GetMaximumRetries(IRequestConfiguration requestConfiguration)
139138
{
140139
//if we have a request specific max retry setting use that
141-
if (requestConfiguration.MaxRetries.HasValue)
140+
if (requestConfiguration != null && requestConfiguration.MaxRetries.HasValue)
142141
return requestConfiguration.MaxRetries.Value;
143142

144143
return this._configurationValues.MaxRetries.GetValueOrDefault(this._connectionPool.MaxRetries);
@@ -260,7 +259,6 @@ private ElasticsearchResponse<Stream> _doRequest(string method, Uri uri, byte[]
260259
throw new Exception("Unknown HTTP method " + method);
261260
}
262261

263-
264262
/* ASYNC *** */
265263
public Task<ElasticsearchResponse<T>> DoRequestAsync<T>(string method, string path, object data = null, IRequestParameters requestParameters = null)
266264
{

0 commit comments

Comments
 (0)