Skip to content

Commit

Permalink
Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrtwhite committed Nov 18, 2024
1 parent f85c4ee commit c72982f
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 c72982f

Please sign in to comment.