Skip to content

Commit c72b3de

Browse files
authored
Check _cleanupTimer is not null when disposing (#5530)
Backporting fix for #4818 This commit checks that _cleanupTimer is not null when disposing, which it may be if no requests have been made. Fixes #5529
1 parent d37899e commit c72b3de

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Elasticsearch.Net/Connection/HandlerTracking/RequestDataHttpClientFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ protected virtual void StopCleanupTimer()
154154
{
155155
lock (_cleanupTimerLock)
156156
{
157-
_cleanupTimer.Dispose();
157+
_cleanupTimer?.Dispose();
158158
_cleanupTimer = null;
159159
}
160160
}

0 commit comments

Comments
 (0)