From bb9e230b35c9b5ac34254a854287825e3dc6255f Mon Sep 17 00:00:00 2001 From: len Date: Fri, 7 Apr 2017 20:32:22 +0200 Subject: [PATCH] Fix #708 --- app/src/main/java/eu/kanade/tachiyomi/util/DiskUtil.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/DiskUtil.kt b/app/src/main/java/eu/kanade/tachiyomi/util/DiskUtil.kt index 851461f53c..1f1587fe68 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/DiskUtil.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/DiskUtil.kt @@ -16,8 +16,11 @@ import java.security.NoSuchAlgorithmException object DiskUtil { fun isImage(name: String, openStream: (() -> InputStream)? = null): Boolean { - val contentType = URLConnection.guessContentTypeFromName(name) - ?: openStream?.let { findImageMime(it) } + val contentType = try { + URLConnection.guessContentTypeFromName(name) + } catch (e: Exception) { + null + } ?: openStream?.let { findImageMime(it) } return contentType?.startsWith("image/") ?: false }