From 74804b27c9f1d356ac200f294659c5cd920a5dab Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Sun, 29 Oct 2017 10:47:54 +0100 Subject: [PATCH] Fix code editor non-string crash --- app/ui/components/codemirror/code-editor.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/ui/components/codemirror/code-editor.js b/app/ui/components/codemirror/code-editor.js index a9085eb87..65da62620 100644 --- a/app/ui/components/codemirror/code-editor.js +++ b/app/ui/components/codemirror/code-editor.js @@ -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