commit: 88db5571417a269df459b243dd96053bf8a9c852
parent 830085b3e429c6d495f48989071e8fc44939b3f9
Author: tusooa <tusooa@kazv.moe>
Date: Thu, 2 Mar 2023 23:47:55 -0500
Make suggestor ignore users without valid names
Otherwise it might have undefined issues.
Resolves https://git.pleroma.social/pleroma/pleroma-fe/-/issues/1249
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/components/emoji_input/suggestor.js b/src/components/emoji_input/suggestor.js
@@ -94,8 +94,9 @@ export const suggestUsers = ({ dispatch, state }) => {
const newSuggestions = state.users.users.filter(
user =>
- user.screen_name.toLowerCase().startsWith(noPrefix) ||
- user.name.toLowerCase().startsWith(noPrefix)
+ user.screen_name && user.name && (
+ user.screen_name.toLowerCase().startsWith(noPrefix) ||
+ user.name.toLowerCase().startsWith(noPrefix))
).slice(0, 20).sort((a, b) => {
let aScore = 0
let bScore = 0