Sanity check

This commit is contained in:
Remy Sharp 2012-06-22 18:04:19 +01:00
parent aee13cdd2e
commit 52c8e4bc5a

View File

@ -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);