mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 16:10:00 +00:00
CoilMediaFetcher.mediaData cannot be null.
This commit is contained in:
+3
-2
@@ -34,12 +34,13 @@ import kotlin.math.roundToLong
|
|||||||
internal class CoilMediaFetcher(
|
internal class CoilMediaFetcher(
|
||||||
private val scalingFunction: (Float) -> Float,
|
private val scalingFunction: (Float) -> Float,
|
||||||
private val mediaLoader: MatrixMediaLoader,
|
private val mediaLoader: MatrixMediaLoader,
|
||||||
private val mediaData: MediaRequestData?,
|
private val mediaData: MediaRequestData,
|
||||||
private val options: Options
|
private val options: Options
|
||||||
) : Fetcher {
|
) : Fetcher {
|
||||||
override suspend fun fetch(): FetchResult? {
|
override suspend fun fetch(): FetchResult? {
|
||||||
if (mediaData?.source == null) return null.also {
|
if (mediaData.source == null) {
|
||||||
Timber.e("MediaData source is null")
|
Timber.e("MediaData source is null")
|
||||||
|
return null
|
||||||
}
|
}
|
||||||
return when (mediaData.kind) {
|
return when (mediaData.kind) {
|
||||||
is MediaRequestData.Kind.Content -> fetchContent(mediaData.source, options)
|
is MediaRequestData.Kind.Content -> fetchContent(mediaData.source, options)
|
||||||
|
|||||||
Reference in New Issue
Block a user