Skip to content

Commit

Permalink
com.utilities.async 2.2.1 (#22)
Browse files Browse the repository at this point in the history
- revert null coalescence for topworker, and added try/catch when attempting to complete
  • Loading branch information
StephenHodgson authored Nov 2, 2024
1 parent 87c6e5d commit 43d44da
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion Runtime/Async/CoroutineWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,18 @@ public IEnumerator Run()

if (processStack.Count == 0)
{
awaiter.Complete((T)currentWorker);
T result = default;

try
{
result = (T)(currentWorker ?? topWorker.Current);
}
catch (Exception)
{
// ignored
}

awaiter.Complete(result ?? default);
yield break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Utilities.Async",
"description": "A set of utilities to ease the use of async methods in Unity.",
"keywords": [],
"version": "2.2.0",
"version": "2.2.1",
"unity": "2020.3",
"documentationUrl": "https://github.com/RageAgainstThePixel/com.utilities.async#documentation",
"changelogUrl": "https://github.com/RageAgainstThePixel/com.utilities.async/releases",
Expand Down

0 comments on commit 43d44da

Please sign in to comment.