Skip to content

Commit 1b0eca9

Browse files
committed
Fixed SendElement.tryResumeSend
Was failing with java.lang.AssertionError at kotlinx.coroutines.channels.SendElement.tryResumeSend(AbstractChannel.kt:1055) at kotlinx.coroutines.channels.AbstractChannel.pollInternal(AbstractChannel.kt:510) at kotlinx.coroutines.channels.AbstractChannel.receive(AbstractChannel.kt:548)
1 parent f24b60c commit 1b0eca9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kotlinx-coroutines-core/common/src/channels/AbstractChannel.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,7 @@ internal class SendElement(
10511051
) : Send() {
10521052
override fun tryResumeSend(otherOp: PrepareOp?): Symbol? {
10531053
otherOp?.finishPrepare()
1054-
val token = cont.tryResume(Unit, otherOp?.desc)
1054+
val token = cont.tryResume(Unit, otherOp?.desc) ?: return null
10551055
assert { token === RESUME_TOKEN } // the only other possible result
10561056
return RESUME_TOKEN
10571057
}

0 commit comments

Comments
 (0)