Skip to content

Commit

Permalink
Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrtwhite committed Nov 19, 2024
1 parent 8d621fb commit d1dcae1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions coil-core/src/commonMain/kotlin/coil3/util/utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ object InternalCoilUtils {
}

fun resolveImmediateDispatcher(context: CoroutineContext): CoroutineContext {
var dispatcher: CoroutineContext? = context[CoroutineDispatcher]
var dispatcher = context[CoroutineDispatcher]
if (dispatcher is MainCoroutineDispatcher) {
try {
dispatcher = dispatcher.immediate
return dispatcher.immediate
} catch (_: UnsupportedOperationException) {}
}
return dispatcher ?: immediateDispatcher
return immediateDispatcher
}
}

0 comments on commit d1dcae1

Please sign in to comment.