From 40f77561761d1a81acc9e9823e975008887eeef9 Mon Sep 17 00:00:00 2001 From: PrivateGER Date: Mon, 12 Jun 2023 16:46:30 +0200 Subject: [PATCH] use actually correct webfinger check --- packages/backend/src/db/meilisearch.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/db/meilisearch.ts b/packages/backend/src/db/meilisearch.ts index 690a71a75..4a8985d08 100644 --- a/packages/backend/src/db/meilisearch.ts +++ b/packages/backend/src/db/meilisearch.ts @@ -186,13 +186,15 @@ export default hasConfig } else if (term.startsWith("from:")) { let user = term.slice(5); + if (user.length === 0) return null; + // Cut off leading @, those aren't saved in the DB if (user.charAt(0) === "@") { user = user.slice(1); } // Determine if we got a webfinger address or a single username - if (user.split("@").length > 0) { + if (user.split("@").length > 1) { let splitUser = user.split("@"); let domain = splitUser.pop();