Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit b87adaf

Browse files
authored
Merge pull request #317 from github/fixes/safe-dispose
Don't throw in Dispose methods
2 parents 9c7c535 + 927b178 commit b87adaf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/GitHub.Api/ApplicationManagerBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ protected virtual void Dispose(bool disposing)
176176
{
177177
if (disposed) return;
178178
disposed = true;
179-
CancellationTokenSource.Cancel();
180-
repositoryManager.Dispose();
179+
if (CancellationTokenSource != null) CancellationTokenSource.Cancel();
180+
if (repositoryManager != null) repositoryManager.Dispose();
181181
}
182182
}
183183

0 commit comments

Comments
 (0)