Skip to content

Commit 36f4aa3

Browse files
committed
Null check for handler
1 parent 2bf54c6 commit 36f4aa3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dotnet/src/webdriver/Remote/HttpCommandExecutor.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,13 +241,14 @@ protected virtual HttpClientHandler CreateHttpClientHandler()
241241

242242
return httpClientHandler;
243243
}
244+
244245
/// <summary>
245246
/// Creates an instance of <see cref="HttpClient"/> used by making all HTTP calls to remote end.
246247
/// </summary>
247248
/// <returns>An instance of <see cref="HttpClient"/>.</returns>
248249
protected virtual HttpClient CreateHttpClient()
249250
{
250-
var httpClientHandler = CreateHttpClientHandler();
251+
var httpClientHandler = CreateHttpClientHandler() ?? throw new InvalidOperationException($"{nameof(CreateHttpClientHandler)} method returned null");
251252

252253
HttpMessageHandler handler = httpClientHandler;
253254

0 commit comments

Comments
 (0)