fedimbed: forgot a null check

This commit is contained in:
Cynthia Foxwell 2025-04-17 23:30:08 -06:00
parent ecebdaa361
commit 5d1c6d1e0c
Signed by: Cynosphere
SSH key fingerprint: SHA256:H3SM8ufP/uxqLwKSH7xY89TDnbR9uOHzjLoBr0tlajk

View file

@ -1485,12 +1485,14 @@ async function processUrl(msg, url, spoiler = false, command = false) {
const newHandle = author.handle.split("@")[0]; const newHandle = author.handle.split("@")[0];
user = `${author.name} (@${newHandle})`; user = `${author.name} (@${newHandle})`;
if (context) {
const contextHandle = context.match(/\(([^@]+?@.+?)\)/)?.[1]; const contextHandle = context.match(/\(([^@]+?@.+?)\)/)?.[1];
if (contextHandle) { if (contextHandle) {
const newContextHandle = "@" + contextHandle.split("@")[0]; const newContextHandle = "@" + contextHandle.split("@")[0];
context = context.replace(contextHandle, newContextHandle); context = context.replace(contextHandle, newContextHandle);
} }
} }
}
const baseEmbed = { const baseEmbed = {
color, color,