add SQLiteBlobTooBigException catch for safeMoveToPosition

This commit is contained in:
Tlaster 2021-03-01 17:23:35 +08:00
parent afac44ca43
commit 17397628fc
1 changed files with 3 additions and 0 deletions

View File

@ -1,6 +1,7 @@
package org.mariotaku.ktextension
import android.database.Cursor
import android.database.sqlite.SQLiteBlobTooBigException
import org.mariotaku.library.objectcursor.ObjectCursor
import java.util.*
@ -12,6 +13,8 @@ fun Cursor.safeMoveToPosition(pos: Int) = try {
moveToPosition(pos)
} catch (e: IllegalStateException) {
false
} catch (e: SQLiteBlobTooBigException) {
false
}
fun Cursor.safeGetLong(columnIndex: Int, def: Long = -1) = try {