fix(ext/settings): guard hostname before remove_blacklist send

This commit is contained in:
adlee-was-taken
2026-05-03 21:06:59 -04:00
parent 7144e40287
commit 9c47709d14

View File

@@ -167,7 +167,8 @@ async function renderAutofillSection(content: HTMLElement): Promise<void> {
content.querySelectorAll<HTMLButtonElement>('.remove-bl').forEach((btn) => {
btn.addEventListener('click', async () => {
const host = btn.dataset.hostname!;
const host = btn.dataset.hostname;
if (!host) return;
await sendMessage({ type: 'remove_blacklist', hostname: host });
renderAutofillSection(content);
});