mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-30 22:07:57 +01:00 
			
		
		
		
	Fix #708
This commit is contained in:
		| @@ -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 | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user