From 806a76c5ca7817646c56ebcc59ca0cdf8812b021 Mon Sep 17 00:00:00 2001 From: Mar0xy Date: Mon, 25 Sep 2023 02:03:16 +0200 Subject: [PATCH] fix: text is undefined in masto status api --- packages/backend/src/server/api/mastodon/endpoints/status.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/mastodon/endpoints/status.ts b/packages/backend/src/server/api/mastodon/endpoints/status.ts index 5ce0c8941..546020d49 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/status.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/status.ts @@ -156,7 +156,7 @@ export class ApiStatusMastodon { ) { body = normalizeQuery(body); } - const text = body.status; + const text = body.status ? body.status : ''; const removed = text.replace(/@\S+/g, '').replace(/\s|/g, ''); const isDefaultEmoji = emojiRegexAtStartToEnd.test(removed); const isCustomEmoji = /^:[a-zA-Z0-9@_]+:$/.test(removed);