forked from GitHub-Mirror/riotX-android
Fix crash when invalid urls for image
This commit is contained in:
parent
302d23ba96
commit
e5adf174a8
@ -28,6 +28,7 @@ import im.vector.riotx.core.di.ActiveSessionHolder
|
||||
import im.vector.riotx.core.glide.GlideApp
|
||||
import im.vector.riotx.core.utils.DimensionUtils.dpToPx
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
import timber.log.Timber
|
||||
import java.io.File
|
||||
import javax.inject.Inject
|
||||
|
||||
@ -94,6 +95,11 @@ class ImageContentRenderer @Inject constructor(private val activeSessionHolder:
|
||||
val fullSize = contentUrlResolver.resolveFullSize(data.url)
|
||||
val thumbnail = contentUrlResolver.resolveThumbnail(data.url, width, height, ContentUrlResolver.ThumbnailMethod.SCALE)
|
||||
|
||||
if (fullSize.isNullOrBlank() || thumbnail.isNullOrBlank()) {
|
||||
Timber.w("Invalid urls")
|
||||
return
|
||||
}
|
||||
|
||||
// TODO DECRYPT_FILE Decrypt file
|
||||
imageView.showImage(
|
||||
Uri.parse(thumbnail),
|
||||
|
Loading…
Reference in New Issue
Block a user