Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullReferenceException when canceling UnityWebRequest with cancelImmediately = true #638

Open
AlexanderLukashin opened this issue Dec 9, 2024 · 1 comment

Comments

@AlexanderLukashin
Copy link

NullReferenceException : Object reference not set to an instance of an object.
       at UnityEngine.Bindings.ThrowHelper.ThrowNullReferenceException(UnityEngine.Bindings.ThrowHelper)
       at UnityEngine.Networking.UnityWebRequest.Abort(UnityEngine.Networking.UnityWebRequest)
       at Cysharp.Threading.Tasks.UnityAsyncExtensions+UnityWebRequestAsyncOperationConfiguredSource.MoveNext(Cysharp.Threading.Tasks.UnityAsyncExtensions+UnityWebRequestAsyncOperationConfiguredSource)
       at Cysharp.Threading.Tasks.Internal.PlayerLoopRunner.RunCore(Cysharp.Threading.Tasks.Internal.PlayerLoopRunner)
       at Cysharp.Threading.Tasks.Internal.PlayerLoopRunner:RunCore(Cysharp.Threading.Tasks.Internal)
@AlexanderLukashin
Copy link
Author

I found out that this code gives this result. Unity 6000.0.30f1

using UnityWebRequest request = UnityWebRequestTexture.GetTexture("file://" + path, true);
await request.SendWebRequest().ToUniTask(cancellationToken: cancellationToken, cancelImmediately: true);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant