aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/activities/ImageActivity.kt4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/ImageActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/ImageActivity.kt
index 15efc527..09620a54 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/activities/ImageActivity.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/ImageActivity.kt
@@ -362,12 +362,12 @@ class ImageActivity : KauBaseActivity() {
.call()
.execute()
- imgExtension = getImageExtension(response.header("Content-Type")) ?: ".jpg"
-
if (!response.isSuccessful) {
throw IOException("Unsuccessful response for image: ${response.peekBody(128).string()}")
}
+ imgExtension = getImageExtension(response.header("Content-Type")) ?: ".jpg"
+
val body = response.body() ?: throw IOException("Failed to retrieve image body")
file.copyFromInputStream(body.byteStream())