From feb8ad2c26b20799360771c510408454256b08ff Mon Sep 17 00:00:00 2001 From: Tomoyuki Hata Date: Sun, 24 May 2020 19:02:28 +0900 Subject: [PATCH] fix(browser): Add undefined check (#5) --- index-browser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index-browser.js b/index-browser.js index 7243db3..d368145 100644 --- a/index-browser.js +++ b/index-browser.js @@ -9,7 +9,7 @@ function fetchDictionary(options) { // for browser that depended on `fetch` API // for browser hack // window["sudachi-synonyms-dictionary"] = "https://example.com/sudachi-synonyms-dictionary.json" - const dictionaryURL = options.url || window["sudachi-synonyms-dictionary"]; + const dictionaryURL = options && options.url || window["sudachi-synonyms-dictionary"]; if (!dictionaryURL) { throw new Error("sudachi-synonyms-dictionary: dictionary url is undefined."); }