You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-26 17:03:12 +03:00
filter out non-string display names
This commit is contained in:
@@ -661,7 +661,9 @@ export function isNumber(value: any): boolean {
|
||||
* @return {string} a string with the hidden characters removed
|
||||
*/
|
||||
export function removeHiddenChars(str: string): string {
|
||||
return unhomoglyph(str.normalize('NFD').replace(removeHiddenCharsRegex, ''));
|
||||
if (typeof str === "string") {
|
||||
return unhomoglyph(str.normalize('NFD').replace(removeHiddenCharsRegex, ''));
|
||||
}
|
||||
}
|
||||
|
||||
// Regex matching bunch of unicode control characters and otherwise misleading/invisible characters.
|
||||
|
||||
Reference in New Issue
Block a user