Skip to content

Commit

Permalink
fixup! fix: Use the DisplayName struct to protect against homoglyph a…
Browse files Browse the repository at this point in the history
…ttacks
  • Loading branch information
poljar committed Nov 13, 2024
1 parent ff56095 commit 426aa5b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions crates/matrix-sdk-base/src/store/ambiguity_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,12 @@ impl AmbiguityCache {
.get(display_name)
.map(|user_ids| is_display_name_ambiguous(display_name, user_ids))
})
.expect(&format!(
"The display name {:?} should be part of the cache {:?}",
display_name, self.cache
))
.unwrap_or_else(|| {
panic!(
"The display name {:?} should be part of the cache {:?}",
display_name, self.cache
)
})
}
}

Expand Down

0 comments on commit 426aa5b

Please sign in to comment.