fix console.error crash (#532)
This commit is contained in:
parent
6faf52f61e
commit
193b15e074
1 changed files with 5 additions and 3 deletions
|
@ -187,9 +187,11 @@ class Editor extends React.Component {
|
||||||
if (this.props.runtimeErrorWarningVisible) {
|
if (this.props.runtimeErrorWarningVisible) {
|
||||||
this.props.consoleEvents.forEach((consoleEvent) => {
|
this.props.consoleEvents.forEach((consoleEvent) => {
|
||||||
if (consoleEvent.method === 'error') {
|
if (consoleEvent.method === 'error') {
|
||||||
const n = consoleEvent.arguments.replace(')', '').split(' ');
|
if (consoleEvent.arguments.indexOf(')') > -1) {
|
||||||
const lineNumber = parseInt(n[n.length - 1], 10) - 1;
|
const n = consoleEvent.arguments.replace(')', '').split(' ');
|
||||||
this._cm.addLineClass(lineNumber, 'background', 'line-runtime-error');
|
const lineNumber = parseInt(n[n.length - 1], 10) - 1;
|
||||||
|
this._cm.addLineClass(lineNumber, 'background', 'line-runtime-error');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue