Fix code editor non-string crash

This commit is contained in:
Gregory Schier 2017-10-29 10:47:54 +01:00
parent 1ed4b51a01
commit 74804b27c9

View File

@ -581,6 +581,11 @@ class CodeEditor extends React.Component {
* @param forcePrettify
*/
_codemirrorSetValue (code, forcePrettify = false) {
if (typeof code !== 'string') {
console.warn('Code editor was passed non-string value', code);
return;
}
this._originalCode = code;
// Don't ignore changes from prettify