From 8fa48f2c193d81d79ae0556d68256ff1c3aa495c Mon Sep 17 00:00:00 2001 From: TacoTheDank Date: Mon, 8 Jun 2020 16:22:25 -0400 Subject: [PATCH] Fix Java interop issues --- .../main/kotlin/org/mariotaku/ktextension/CursorExtensions.kt | 2 +- .../twidere/extension/mime4j/ContentTypeFieldExtensions.kt | 2 +- .../twidere/extension/model/ParcelableCardEntityExtensions.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/twidere/src/main/kotlin/org/mariotaku/ktextension/CursorExtensions.kt b/twidere/src/main/kotlin/org/mariotaku/ktextension/CursorExtensions.kt index ac6952906..34c70b59b 100644 --- a/twidere/src/main/kotlin/org/mariotaku/ktextension/CursorExtensions.kt +++ b/twidere/src/main/kotlin/org/mariotaku/ktextension/CursorExtensions.kt @@ -26,7 +26,7 @@ fun Cursor.safeGetInt(columnIndex: Int, def: Int = -1) = try { def } -fun Cursor.safeGetString(columnIndex: Int, def: String = "") = try { +fun Cursor.safeGetString(columnIndex: Int, def: String = ""): String = try { getString(columnIndex) } catch (e: IllegalStateException) { def diff --git a/twidere/src/main/kotlin/org/mariotaku/twidere/extension/mime4j/ContentTypeFieldExtensions.kt b/twidere/src/main/kotlin/org/mariotaku/twidere/extension/mime4j/ContentTypeFieldExtensions.kt index b8db4482b..d45fb1c01 100644 --- a/twidere/src/main/kotlin/org/mariotaku/twidere/extension/mime4j/ContentTypeFieldExtensions.kt +++ b/twidere/src/main/kotlin/org/mariotaku/twidere/extension/mime4j/ContentTypeFieldExtensions.kt @@ -30,5 +30,5 @@ fun ContentTypeField.getIntParameter(name: String, def: Int): Int { } fun ContentTypeField.getBooleanParameter(name: String): Boolean { - return getParameter(name).toBoolean() + return this.getParameter(name)!!.toBoolean() } \ No newline at end of file diff --git a/twidere/src/main/kotlin/org/mariotaku/twidere/extension/model/ParcelableCardEntityExtensions.kt b/twidere/src/main/kotlin/org/mariotaku/twidere/extension/model/ParcelableCardEntityExtensions.kt index e4b26e71d..3725cbe96 100644 --- a/twidere/src/main/kotlin/org/mariotaku/twidere/extension/model/ParcelableCardEntityExtensions.kt +++ b/twidere/src/main/kotlin/org/mariotaku/twidere/extension/model/ParcelableCardEntityExtensions.kt @@ -46,7 +46,7 @@ fun CardEntity.toParcelable(accountKey: UserKey, accountType: String): Parcelabl fun ParcelableCardEntity.getAsBoolean(key: String, def: Boolean): Boolean { val value = getValue(key) ?: return def - return value.value.toBoolean() + return value.value!!.toBoolean() } fun ParcelableCardEntity.getAsString(key: String, def: String?): String? {