From 45bd1061d2ad33b8752e88bfd887a2b86eec7f7f Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 6 Apr 2022 11:06:43 +0200 Subject: [PATCH] Small optimization --- .../detail/timeline/action/MessageActionsEpoxyController.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/action/MessageActionsEpoxyController.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/action/MessageActionsEpoxyController.kt index 05758bec31..788c89e3b0 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/action/MessageActionsEpoxyController.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/action/MessageActionsEpoxyController.kt @@ -223,10 +223,11 @@ class MessageActionsEpoxyController @Inject constructor( if (!isLocationEvent) return null val locationContent = clearContent.toModel(catchError = true) - val locationUrl = locationContent?.toLocationData() + ?: return null + val locationUrl = locationContent.toLocationData() ?.let { urlMapProvider.buildStaticMapUrl(it, INITIAL_MAP_ZOOM_IN_TIMELINE, 1200, 800) } ?: return null - val locationOwnerId = if (locationContent.isSelfLocation().orTrue()) state.informationData.matrixItem.id else null + val locationOwnerId = if (locationContent.isSelfLocation()) state.informationData.matrixItem.id else null return LocationUiData( locationUrl = locationUrl,