From 84bcd8d1d228e9687f4542e429407c74e73684bd Mon Sep 17 00:00:00 2001 From: Ivan Iskandar <12537387+ivaniskandar@users.noreply.github.com> Date: Wed, 19 Oct 2022 18:59:05 +0700 Subject: [PATCH] Fix crash when saving a page from certain chapters (#8242) --- .../main/java/eu/kanade/tachiyomi/data/saver/ImageSaver.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/saver/ImageSaver.kt b/app/src/main/java/eu/kanade/tachiyomi/data/saver/ImageSaver.kt index d683eb0aac..06457f0bc0 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/saver/ImageSaver.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/saver/ImageSaver.kt @@ -101,14 +101,13 @@ class ImageSaver( MediaStore.MediaColumns.DATE_MODIFIED, ) - val selection = "${MediaStore.MediaColumns.RELATIVE_PATH}='$relativePath' AND " + - "${MediaStore.MediaColumns.DISPLAY_NAME}='$imagePath'" + val selection = "${MediaStore.MediaColumns.RELATIVE_PATH}=? AND ${MediaStore.MediaColumns.DISPLAY_NAME}=?" context.contentResolver.query( MediaStore.Images.Media.EXTERNAL_CONTENT_URI, projection, selection, - null, + arrayOf(relativePath, imagePath), null, ).use { cursor -> if (cursor != null && cursor.count >= 1) {