do not allow "null" as an account name

This commit is contained in:
Vipra 2023-07-19 23:23:19 +02:00 committed by Jasmin
parent 5cc45f5d56
commit 43adaf4a61

View file

@ -30,7 +30,7 @@ import {
accountNameFromURL,
addTypeAttribute,
normaliseAccountName,
} from "../libs/protootshelpers";
} from "../libs/protootshelpers.js";
//before anything else, check whether we're on a Mastodon page
checkSite();
@ -330,7 +330,9 @@ async function addProplate(element) {
if (!accountNameEl) accountNameEl = getAccountNameEl(element, ".status__display-name");
let accountName = getAccountName(accountNameEl, "title");
if (!accountName) accountName = accountNameFromURL(getAccountName(accountNameEl, "href"));
if (accountName == "null")
accountName = accountNameFromURL(getAccountName(accountNameEl, "href"));
if (accountName == "null") return;
let nametagEl = getNametagEl(element, ".notification__display-name");
if (!nametagEl) return;