fedimbed: forgot a null check
This commit is contained in:
parent
ecebdaa361
commit
5d1c6d1e0c
1 changed files with 6 additions and 4 deletions
|
@ -1485,10 +1485,12 @@ 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})`;
|
||||||
|
|
||||||
const contextHandle = context.match(/\(([^@]+?@.+?)\)/)?.[1];
|
if (context) {
|
||||||
if (contextHandle) {
|
const contextHandle = context.match(/\(([^@]+?@.+?)\)/)?.[1];
|
||||||
const newContextHandle = "@" + contextHandle.split("@")[0];
|
if (contextHandle) {
|
||||||
context = context.replace(contextHandle, newContextHandle);
|
const newContextHandle = "@" + contextHandle.split("@")[0];
|
||||||
|
context = context.replace(contextHandle, newContextHandle);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue