Skip to content

Commit

Permalink
Prevent mention crashes when room members are missing display names (…
Browse files Browse the repository at this point in the history
…objc interop)
  • Loading branch information
stefanceriu committed Aug 21, 2023
1 parent 6faf14d commit 0464ded
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,14 @@ class WysiwygInputToolbarView: MXKRoomInputToolbarView, NibLoadable, HtmlRoomInp
}

func mention(_ member: MXRoomMember) {
self.wysiwygViewModel.setMention(url: MXTools.permalinkToUser(withUserId: member.userId),
name: member.displayname,
guard let userId = member.userId else {
return
}

let displayName = member.displayname ?? userId

self.wysiwygViewModel.setMention(url: MXTools.permalinkToUser(withUserId: userId),
name: displayName,
mentionType: .user)
}

Expand Down

0 comments on commit 0464ded

Please sign in to comment.