Merge pull request #399 from shiena/fix/prevent-nre

fix: prevent NullReferenceException in TimeoutController
master
Yoshifumi Kawai 2022-09-30 18:04:57 +09:00 committed by GitHub
commit 8300c1b1e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -99,7 +99,7 @@ namespace Cysharp.Threading.Tasks
public void Reset() public void Reset()
{ {
timer.Stop(); timer?.Stop();
} }
public void Dispose() public void Dispose()
@ -109,7 +109,7 @@ namespace Cysharp.Threading.Tasks
try try
{ {
// stop timer. // stop timer.
timer.Dispose(); timer?.Dispose();
// cancel and dispose. // cancel and dispose.
timeoutSource.Cancel(); timeoutSource.Cancel();