From ef8efa049c5a901a049628fe766364df5e137f42 Mon Sep 17 00:00:00 2001 From: glacambre Date: Fri, 4 Oct 2019 08:34:35 +0200 Subject: [PATCH] content.ts: make error message legible on undefined config --- src/content.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/content.ts b/src/content.ts index 8e354cf..5b1ddb1 100644 --- a/src/content.ts +++ b/src/content.ts @@ -210,6 +210,9 @@ browser.storage.local.get("localSettings").then(async ({ localSettings }: { [key } return val; } + if (localSettings === undefined) { + throw new Error("Error: your settings are undefined. Try reloading the page. If this error persists, try the troubleshooting guide: https://github.com/glacambre/firenvim/blob/master/TROUBLESHOOTING.md"); + } const [, conf] = Array.from(Object.entries(localSettings)) .sort((e1, e2) => (or1(e2[1].priority) - or1(e1[1].priority))) .find(([pat, sel]) => (new RegExp(pat)).test(document.location.href)); -- 2.34.2