diff --git a/vector/src/main/java/im/vector/app/features/notifications/NotifiableEventResolver.kt b/vector/src/main/java/im/vector/app/features/notifications/NotifiableEventResolver.kt index 951b593358..23f9fc307b 100644 --- a/vector/src/main/java/im/vector/app/features/notifications/NotifiableEventResolver.kt +++ b/vector/src/main/java/im/vector/app/features/notifications/NotifiableEventResolver.kt @@ -208,11 +208,15 @@ class NotifiableEventResolver @Inject constructor( } private suspend fun TimelineEvent.downloadAndExportImage(session: Session): Uri? { - return getLastMessageContent()?.takeAs()?.let { imageMessage -> - val fileService = session.fileService() - fileService.downloadFile(imageMessage) - fileService.getTemporarySharableURI(imageMessage) - } + return kotlin.runCatching { + getLastMessageContent()?.takeAs()?.let { imageMessage -> + val fileService = session.fileService() + fileService.downloadFile(imageMessage) + fileService.getTemporarySharableURI(imageMessage) + } + }.onFailure { + Timber.e(it, "Failed to download and export image for notification") + }.getOrNull() } private fun resolveStateRoomEvent(event: Event, session: Session, canBeReplaced: Boolean, isNoisy: Boolean): NotifiableEvent? {