Skip to content

Commit

Permalink
add SQLiteBlobTooBigException catch for safeMoveToPosition
Browse files Browse the repository at this point in the history
  • Loading branch information
Tlaster committed Mar 1, 2021
1 parent afac44c commit 1739762
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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.*

Expand All @@ -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 {
Expand Down

0 comments on commit 1739762

Please sign in to comment.