adding a crashfix at storing contact photo
This commit is contained in:
parent
c6a86fe4a7
commit
867b499eab
1 changed files with 5 additions and 1 deletions
|
|
@ -290,7 +290,11 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
|
||||||
|
|
||||||
val photoByteArray = cursor.getBlobValue(COL_PHOTO) ?: null
|
val photoByteArray = cursor.getBlobValue(COL_PHOTO) ?: null
|
||||||
val photo = if (photoByteArray?.isNotEmpty() == true) {
|
val photo = if (photoByteArray?.isNotEmpty() == true) {
|
||||||
BitmapFactory.decodeByteArray(photoByteArray, 0, photoByteArray.size)
|
try {
|
||||||
|
BitmapFactory.decodeByteArray(photoByteArray, 0, photoByteArray.size)
|
||||||
|
} catch (e: OutOfMemoryError) {
|
||||||
|
null
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue