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

Fix crash in CoroutineQueue #421

Merged
merged 1 commit into from
Nov 20, 2023
Merged

Fix crash in CoroutineQueue #421

merged 1 commit into from
Nov 20, 2023

Conversation

mickael-menu
Copy link
Member

CoroutineQueue could crash during initialization if the tasks coroutine executes before the object is fully initialized. Moving the tasks property above init should fix the issue.

java.lang.NullPointerException: Attempt to invoke interface method 'kotlinx.coroutines.channels.ChannelIterator kotlinx.coroutines.channels.Channel.iterator()' on a null object reference
    at org.readium.r2.shared.util.CoroutineQueue$1.invokeSuspend(CoroutineQueue.kt:36)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)

@mickael-menu mickael-menu requested a review from qnga November 20, 2023 09:40
@qnga qnga merged commit 3ce38c6 into v3 Nov 20, 2023
3 checks passed
@qnga qnga deleted the fix-coroutine-queue branch November 20, 2023 11:29
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

Successfully merging this pull request may close these issues.

2 participants