Fix: Crash in BookInfo. (When deleting cover image)
This commit is contained in:
parent
75587b46aa
commit
69a72c59fc
1 changed files with 9 additions and 4 deletions
|
|
@ -401,10 +401,15 @@ class BookRepositoryImpl @Inject constructor(
|
||||||
val byteArray = stream.toByteArray()
|
val byteArray = stream.toByteArray()
|
||||||
val defaultCover = BitmapFactory.decodeByteArray(byteArray, 0, byteArray.size)
|
val defaultCover = BitmapFactory.decodeByteArray(byteArray, 0, byteArray.size)
|
||||||
|
|
||||||
val currentCover = MediaStore.Images.Media.getBitmap(
|
val currentCover = try {
|
||||||
|
MediaStore.Images.Media.getBitmap(
|
||||||
application.contentResolver,
|
application.contentResolver,
|
||||||
Uri.parse(book.image)
|
Uri.parse(book.image)
|
||||||
)
|
)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
e.printStackTrace()
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
return !defaultCover.sameAs(currentCover)
|
return !defaultCover.sameAs(currentCover)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue