mirror of
https://github.com/Cysharp/UniTask.git
synced 2026-05-22 15:50:10 +00:00
Add check if UnityWebRequest was destroyed
This commit is contained in:
@@ -900,7 +900,11 @@ namespace Cysharp.Threading.Tasks
|
|||||||
|
|
||||||
if (asyncOperation.isDone)
|
if (asyncOperation.isDone)
|
||||||
{
|
{
|
||||||
if (asyncOperation.webRequest.IsError())
|
if (asyncOperation.webRequest == null)
|
||||||
|
{
|
||||||
|
core.TrySetException(new ObjectDisposedException("The webRequest has been destroyed."));
|
||||||
|
}
|
||||||
|
else if (asyncOperation.webRequest.IsError())
|
||||||
{
|
{
|
||||||
core.TrySetException(new UnityWebRequestException(asyncOperation.webRequest));
|
core.TrySetException(new UnityWebRequestException(asyncOperation.webRequest));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user