mirror of
https://github.com/cmclark00/RetroMusicPlayer.git
synced 2025-05-19 16:45:20 +01:00
Fixed some crashes
- Import playlist crash - Create new backup crash
This commit is contained in:
parent
ac902d0bf0
commit
5e08b889c1
3 changed files with 11 additions and 5 deletions
|
@ -20,7 +20,7 @@ import android.database.Cursor
|
|||
|
||||
internal fun Cursor.getInt(columnName: String): Int {
|
||||
try {
|
||||
return this.getInt(this.getColumnIndex(columnName))
|
||||
return getInt(getColumnIndexOrThrow(columnName))
|
||||
} catch (ex: Throwable) {
|
||||
throw IllegalStateException("invalid column $columnName", ex)
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ internal fun Cursor.getInt(columnName: String): Int {
|
|||
|
||||
internal fun Cursor.getLong(columnName: String): Long {
|
||||
try {
|
||||
return this.getLong(this.getColumnIndex(columnName))
|
||||
return getLong(getColumnIndexOrThrow(columnName))
|
||||
} catch (ex: Throwable) {
|
||||
throw IllegalStateException("invalid column $columnName", ex)
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ internal fun Cursor.getLong(columnName: String): Long {
|
|||
|
||||
internal fun Cursor.getString(columnName: String): String {
|
||||
try {
|
||||
return this.getString(this.getColumnIndex(columnName))
|
||||
return getString(getColumnIndexOrThrow(columnName))
|
||||
} catch (ex: Throwable) {
|
||||
throw IllegalStateException("invalid column $columnName", ex)
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ internal fun Cursor.getString(columnName: String): String {
|
|||
|
||||
internal fun Cursor.getStringOrNull(columnName: String): String? {
|
||||
try {
|
||||
return this.getString(this.getColumnIndex(columnName))
|
||||
return getString(getColumnIndexOrThrow(columnName))
|
||||
} catch (ex: Throwable) {
|
||||
throw IllegalStateException("invalid column $columnName", ex)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue