diff --git a/public/js/render/live.js b/public/js/render/live.js index 944ac8ce..41dbe0e5 100644 --- a/public/js/render/live.js +++ b/public/js/render/live.js @@ -49,7 +49,7 @@ function codeChangeLive(event, data) { // ignore } else if (panel.visible) { // test to see if they're write a while loop - if (jsbin.panels.focused.id === 'javascript') { + if (jsbin.panels.focused && jsbin.panels.focused.id === 'javascript') { // check the current line doesn't match a for or a while or a do - which could trip in to an infinite loop editor = jsbin.panels.focused.editor; line = editor.getLine(editor.getCursor().line);