mirror of
https://github.com/Cysharp/UniTask.git
synced 2026-05-17 12:40:11 +00:00
Merge pull request #399 from shiena/fix/prevent-nre
fix: prevent NullReferenceException in TimeoutController
This commit is contained in:
@@ -99,7 +99,7 @@ namespace Cysharp.Threading.Tasks
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
timer.Stop();
|
||||
timer?.Stop();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
@@ -109,7 +109,7 @@ namespace Cysharp.Threading.Tasks
|
||||
try
|
||||
{
|
||||
// stop timer.
|
||||
timer.Dispose();
|
||||
timer?.Dispose();
|
||||
|
||||
// cancel and dispose.
|
||||
timeoutSource.Cancel();
|
||||
|
||||
Reference in New Issue
Block a user