Skip to content

Commit

Permalink
test for empty string in mentions
Browse files Browse the repository at this point in the history
  • Loading branch information
davotoula committed Nov 7, 2024
1 parent 7146838 commit abf6cc0
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,10 @@ open class NewPostViewModel : ViewModel() {
if (replyNote.event !is CommunityDefinitionEvent) {
replyNote.author?.let { replyUser ->
val currentMentions =
(replyNote.event as? TextNoteEvent)?.mentions()?.map { LocalCache.getOrCreateUser(it) }
(replyNote.event as? TextNoteEvent)
?.mentions()
?.filter { it.isNotEmpty() }
?.map { LocalCache.getOrCreateUser(it) }
?: emptyList()

if (currentMentions.contains(replyUser)) {
Expand Down

0 comments on commit abf6cc0

Please sign in to comment.