Fix crash when saving a page from certain chapters (#8242)

(cherry picked from commit 84bcd8d1d228e9687f4542e429407c74e73684bd)
This commit is contained in:
Ivan Iskandar 2022-10-19 18:59:05 +07:00 committed by Jobobby04
parent 3cccf2e2c1
commit b29fc922cb

View File

@ -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) {