diff --git a/HISTORY.md b/HISTORY.md index 09c8ba1..b8ba416 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -8,6 +8,8 @@ https://github.com/josdejong/jsoneditor - Implemented Japanese translation (`ja`). Thanks @yutakiyama. - Implemented French translation (`fr-FR`), and some improvements in the translation. Thanks @yannickyvin. +- Fixed #824: Parse errors not displayed with bottom right error icon in modes + `code` and `text`. ## 2019-10-13, version 7.1.0 diff --git a/src/js/ErrorTable.js b/src/js/ErrorTable.js index 736b9e9..0da8761 100644 --- a/src/js/ErrorTable.js +++ b/src/js/ErrorTable.js @@ -161,6 +161,7 @@ export class ErrorTable { this.dom.parseErrorIndication.title = !isNaN(line) ? ('parse error on line ' + line) : 'parse error - check that the json is valid' + this.dom.parseErrorIndication.onclick = this.toggleTableVisibility.bind(this) } else { this.dom.parseErrorIndication.style.display = 'none' } diff --git a/src/js/textmode.js b/src/js/textmode.js index 211dcc7..55723ec 100644 --- a/src/js/textmode.js +++ b/src/js/textmode.js @@ -806,7 +806,7 @@ textmode._renderErrors = function (errors) { const jsonText = this.getText() const errorPaths = [] errors.reduce((acc, curr) => { - if (acc.indexOf(curr.dataPath) === -1) { + if (typeof curr.dataPath === 'string' && acc.indexOf(curr.dataPath) === -1) { acc.push(curr.dataPath) } return acc