Skip to content

Commit

Permalink
[trikot-viewmodels-declarative-flow] Fix crash in FlowExtensions wrap…
Browse files Browse the repository at this point in the history
… method (#178)
  • Loading branch information
frobert11 authored Aug 21, 2023
1 parent 41e0388 commit bcb8778
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fun interface Closeable {
fun close()
}

class VMDFlow<T : Any> internal constructor(
class VMDFlow<T : Any?> internal constructor(
private val origin: Flow<T>,
private val dispatcher: CoroutineDispatcher = Dispatchers.Main.immediate
) : Flow<T> by origin {
Expand All @@ -35,7 +35,7 @@ class VMDFlow<T : Any> internal constructor(
}
}

fun <T : Any> Flow<T>.wrap(): VMDFlow<T> = VMDFlow(this)
fun <T : Any?> Flow<T>.wrap(): VMDFlow<T> = VMDFlow(this)

fun Flow<String>.asVMDTextContent(): Flow<VMDTextContent> = flow {
this@asVMDTextContent.collect { emit(VMDTextContent(it)) }
Expand Down

0 comments on commit bcb8778

Please sign in to comment.