Skip to content

Commit

Permalink
util: correctly throw channel errors
Browse files Browse the repository at this point in the history
Wasn't being properly handled before, leading to weird behavior.
  • Loading branch information
OxygenCobalt committed Jan 1, 2024
1 parent ed519ee commit 77f0bbe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/src/main/java/org/oxycblt/auxio/util/StateUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ suspend fun <E> ReceiveChannel<E>.forEachWithTimeout(
var subsequent = false
val handler: suspend () -> Unit = {
val value = receiveCatching()
if (value.isClosed) {
if (value.isClosed && value.exceptionOrNull() == null) {
exhausted = true
} else {
action(value.getOrThrow())
Expand Down

0 comments on commit 77f0bbe

Please sign in to comment.