diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/MediaSaverToDisk.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/MediaSaverToDisk.kt index 5e7583c6f..78308d2c4 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/MediaSaverToDisk.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/MediaSaverToDisk.kt @@ -120,8 +120,8 @@ object MediaSaverToDisk { check(response.isSuccessful) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { - val contentType = response.header("Content-Type") - checkNotNull(contentType) { "Can't find out the content type" } + val contentType = response.header("Content-Type") ?: getMimeTypeFromExtension(url) + check(contentType.isNotBlank()) { "Can't find out the content type" } val realType = if (contentType == "application/octet-stream") {