diff --git a/app/src/main/java/org/tasks/data/OpenTaskDao.kt b/app/src/main/java/org/tasks/data/OpenTaskDao.kt index 7315cee97..5f232add0 100644 --- a/app/src/main/java/org/tasks/data/OpenTaskDao.kt +++ b/app/src/main/java/org/tasks/data/OpenTaskDao.kt @@ -155,13 +155,13 @@ open class OpenTaskDao @Inject constructor( fun String?.isDecSync(): Boolean = this?.startsWith(ACCOUNT_TYPE_DECSYNC) == true private fun Cursor.getString(columnName: String): String? = - getString(getColumnIndex(columnName)) + getString(getColumnIndexOrThrow(columnName)) private fun Cursor.getInt(columnName: String): Int = - getInt(getColumnIndex(columnName)) + getInt(getColumnIndexOrThrow(columnName)) fun Cursor.getLong(columnName: String): Long = - getLong(getColumnIndex(columnName)) + getLong(getColumnIndexOrThrow(columnName)) fun CaldavCalendar.toLocalCalendar(): CaldavCalendar { val remote = this diff --git a/app/src/main/java/org/tasks/files/FileHelper.kt b/app/src/main/java/org/tasks/files/FileHelper.kt index a9b38cc7c..f74a700e6 100644 --- a/app/src/main/java/org/tasks/files/FileHelper.kt +++ b/app/src/main/java/org/tasks/files/FileHelper.kt @@ -102,7 +102,7 @@ object FileHelper { val cursor = context.contentResolver.query(uri, null, null, null, null) if (cursor != null && cursor.moveToFirst()) { return try { - cursor.getString(cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME)) + cursor.getString(cursor.getColumnIndexOrThrow(OpenableColumns.DISPLAY_NAME)) } finally { cursor.close() }