Skip to content

Commit

Permalink
fix mention crash
Browse files Browse the repository at this point in the history
closes: #747

Signed-off-by: kernelkind <[email protected]>
  • Loading branch information
kernelkind committed Feb 25, 2025
1 parent 660b7cc commit 615e27c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions crates/notedeck_columns/src/post.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,12 @@ impl PostBuffer {
if let Some(info) = self.mentions.get(mention_ind) {
if let MentionType::Finalized(pk) = info.mention_type {
if let Some(bech) = pk.to_bech() {
out.replace_range(info.start_index..*cur_end_ind, &format!("nostr:{bech}"));
mentions.push(pk);
if let Some(byte_range) =
char_indices_to_byte(&out, info.start_index..*cur_end_ind)
{
out.replace_range(byte_range, &format!("nostr:{bech}"));
mentions.push(pk);
}
}
}
}
Expand Down

0 comments on commit 615e27c

Please sign in to comment.