Skip to content

Commit

Permalink
Fix error when window.onerror is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
gravityrail committed Feb 4, 2016
1 parent 473a7e8 commit f705bb0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/catch-js-errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@
// set up handler to POST errors
window.onerror = debounce( function( message, scriptUrl, lineNumber, columnNumber, error ) {
sendErrorsToApi( message, scriptUrl, lineNumber, columnNumber, error );
savedWindowOnError();
if ( savedWindowOnError ) {
savedWindowOnError();
}
}, 100 );
}
}
Expand Down

0 comments on commit f705bb0

Please sign in to comment.