Skip to content

Commit

Permalink
fix(browser): Add undefined check (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
hata6502 authored May 24, 2020
1 parent 7c0da60 commit feb8ad2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}
Expand Down

0 comments on commit feb8ad2

Please sign in to comment.