Skip to content

Commit

Permalink
Merge pull request #494 from Cysharp/hadashiA/web-req-null-check
Browse files Browse the repository at this point in the history
Add check if UnityWebRequest was destroyed
  • Loading branch information
hadashiA committed Sep 7, 2023
2 parents c1042b3 + 9135c7c commit f203b6c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,11 @@ public bool MoveNext()

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));
}
Expand Down

0 comments on commit f203b6c

Please sign in to comment.