fix: app crash when message id is null #28

Merged
reya merged 3 commits from fix-crash into master 2026-06-27 03:26:09 +00:00
Showing only changes of commit 2c3351e3b9 - Show all commits

View File

@@ -18,8 +18,8 @@ fun Room.nameFlow(viewModel: NostrViewModel): Flow<String> {
return combine(displayMembers.map { viewModel.getMetadata(it) }) { metadataArray -> return combine(displayMembers.map { viewModel.getMetadata(it) }) { metadataArray ->
val names = metadataArray.mapIndexed { i, metadata -> val names = metadataArray.mapIndexed { i, metadata ->
val profile = metadata?.asRecord() val profile = metadata?.asRecord()
profile?.name?.takeIf { it.isNotBlank() } profile?.displayName?.takeIf { it.isNotBlank() }
?: profile?.displayName?.takeIf { it.isNotBlank() } ?: profile?.name?.takeIf { it.isNotBlank() }
?: displayMembers[i].short() ?: displayMembers[i].short()
} }