From dd89b87aeac1e146a94ed38e685014bd059bb949 Mon Sep 17 00:00:00 2001 From: litruv Date: Mon, 5 Oct 2026 13:59:53 +1100 Subject: [PATCH] notifications: fix Kotlin null-safety in resolveInlineImage (?.takeIf on nullable receivers) --- .../app/src/main/java/com/paarrot/app/MatrixSyncService.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/android/app/src/main/java/com/paarrot/app/MatrixSyncService.kt b/android/app/src/main/java/com/paarrot/app/MatrixSyncService.kt index f2e94bb..3268b5e 100644 --- a/android/app/src/main/java/com/paarrot/app/MatrixSyncService.kt +++ b/android/app/src/main/java/com/paarrot/app/MatrixSyncService.kt @@ -698,8 +698,8 @@ class MatrixSyncService : Service() { ): Bitmap? { val info = content.optJSONObject("info") val thumbnailMxc = - info?.optString("thumbnail_url").takeIf { it.startsWith("mxc://") } - ?: info?.optJSONObject("thumbnail_file")?.optString("url").takeIf { it.startsWith("mxc://") } + info?.optString("thumbnail_url")?.takeIf { it.startsWith("mxc://") } + ?: info?.optJSONObject("thumbnail_file")?.optString("url")?.takeIf { it.startsWith("mxc://") } if (thumbnailMxc != null) { for (url in mxcToThumbnailUrls(thumbnailMxc, homeserver, 512)) { downloadBitmap(url, token)?.let { return it } @@ -707,7 +707,7 @@ class MatrixSyncService : Service() { } val fullMxc = content.optString("url").takeIf { it.startsWith("mxc://") } - ?: content.optJSONObject("file")?.optString("url").takeIf { it.startsWith("mxc://") } + ?: content.optJSONObject("file")?.optString("url")?.takeIf { it.startsWith("mxc://") } if (fullMxc != null) { for (url in mxcToDownloadUrls(fullMxc, homeserver)) { downloadBitmap(url, token)?.let { return it }