diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/store/db/Helper.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/store/db/Helper.kt index b1e1cb4426..3f9aea3369 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/store/db/Helper.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/store/db/Helper.kt @@ -43,7 +43,7 @@ fun doWithRealm(realmConfiguration: RealmConfiguration, action: (Realm) -> T fun doRealmQueryAndCopy(realmConfiguration: RealmConfiguration, action: (Realm) -> T?): T? { return Realm.getInstance(realmConfiguration).use { realm -> val result = action.invoke(realm) - result?.let { realm.copyFromRealm(result) } + result?.let { realm.copyFromRealm(it) } } } @@ -53,7 +53,7 @@ fun doRealmQueryAndCopy(realmConfiguration: RealmConfiguration fun doRealmQueryAndCopyList(realmConfiguration: RealmConfiguration, action: (Realm) -> Iterable): Iterable { return Realm.getInstance(realmConfiguration).use { realm -> val result = action.invoke(realm) - return realm.copyFromRealm(result) + realm.copyFromRealm(result) } } diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/DefaultItemFactory.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/DefaultItemFactory.kt index f0671decd8..cfa689b7ff 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/DefaultItemFactory.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/DefaultItemFactory.kt @@ -33,7 +33,7 @@ class DefaultItemFactory @Inject constructor(private val avatarSizeProvider: Ava fun create(text: String, informationData: MessageInformationData, highlight: Boolean, - callback: TimelineEventController.Callback?): DefaultItem? { + callback: TimelineEventController.Callback?): DefaultItem { return DefaultItem_() .leftGuideline(avatarSizeProvider.leftGuideline) @@ -49,7 +49,7 @@ class DefaultItemFactory @Inject constructor(private val avatarSizeProvider: Ava highlight: Boolean, readMarkerVisible: Boolean, callback: TimelineEventController.Callback?, - exception: Exception? = null): DefaultItem? { + exception: Exception? = null): DefaultItem { val text = if (exception == null) { "${event.root.getClearType()} events are not yet handled" } else {