diff --git a/CHANGELOG.md b/CHANGELOG.md index 664ec3bb..fb61bd24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,8 +17,9 @@ _This release is scheduled to be released on 2021-01-01._ ### Fixed -- Calendar parsing where RRULE bug returns wrong date, add Windows timezone name support. -- Wrong node-ical version installed (package.json) requested version. +- JSON Parse translation files with comments crashing UI. (#2149) +- Calendar parsing where RRULE bug returns wrong date, add Windows timezone name support. (#2145, #2151) +- Wrong node-ical version installed (package.json) requested version. (#2153) ## [2.13.0] - 2020-10-01 diff --git a/js/translator.js b/js/translator.js index 0f4bc00a..5dc50045 100644 --- a/js/translator.js +++ b/js/translator.js @@ -19,7 +19,15 @@ var Translator = (function () { xhr.open("GET", file, true); xhr.onreadystatechange = function () { if (xhr.readyState === 4 && xhr.status === 200) { - callback(JSON.parse(xhr.responseText)); + // needs error handler try/catch at least + let fileinfo = null; + try { + fileinfo = JSON.parse(xhr.responseText); + } catch (exception) { + // nothing here, but don't die + Log.error(" loading json file =" + file + " failed"); + } + callback(fileinfo); } }; xhr.send(null);