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 0e419e04c..0430a5029 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 @@ -97,15 +97,16 @@ object MediaSaverToDisk { onSuccess: () -> Any?, onError: (Throwable) -> Any?, ) { - val client = okHttpClient(url) - val request = - Request - .Builder() - .get() - .url(url) - .build() - try { + val client = okHttpClient(url) + + val request = + Request + .Builder() + .get() + .url(url) + .build() + client.newCall(request).executeAsync().use { response -> withContext(Dispatchers.IO) { check(response.isSuccessful)