From 8c306180e94fd05a6d23c7e5642cdc2b68e0d807 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Fri, 26 Apr 2024 18:22:53 -0400 Subject: [PATCH] Fix --- commands/edit-image-text/tweet.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/edit-image-text/tweet.js b/commands/edit-image-text/tweet.js index 3b239273..b91034a8 100644 --- a/commands/edit-image-text/tweet.js +++ b/commands/edit-image-text/tweet.js @@ -250,7 +250,7 @@ module.exports = class TweetCommand extends Command { if (i !== 0) preWords += ' '; const emoji = preWords.match(emojiRegex()); let preLen = ctx.measureText(preWords.replace(emojiRegex(), '')).width; - preLen += emoji.length * emojiSize; + if (emoji) preLen += emoji.length * emojiSize; const oldStyle = ctx.fillStyle; ctx.fillStyle = '#1da1f2'; ctx.fillText(word, x + preLen, y + (height * currentLine));