fix(browser-extension): possible undefined
This commit is contained in:
parent
ceb00de0fa
commit
274f282fbc
@ -104,7 +104,7 @@ const suppressLastError = () => void browser.runtime.lastError;
|
|||||||
*/
|
*/
|
||||||
async function enableIcon(hostname, tabId) {
|
async function enableIcon(hostname, tabId) {
|
||||||
const state = await getState(hostname);
|
const state = await getState(hostname);
|
||||||
const path = state.issue.url ? '/assets/icons/warn.png' : '/assets/icons/on.png';
|
const path = state.issue?.url ? '/assets/icons/warn.png' : '/assets/icons/on.png';
|
||||||
|
|
||||||
await browser.action.setIcon({ path, tabId }, suppressLastError);
|
await browser.action.setIcon({ path, tabId }, suppressLastError);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user