diff --git a/js/functions.js b/js/functions.js index a8595a157e..fdae296e8c 100644 --- a/js/functions.js +++ b/js/functions.js @@ -2396,7 +2396,7 @@ $(document).ready(function() { */ $(document).ready(function() { var elm = $('#sqlquery'); - if (elm) { + if (elm.length > 0) { codemirror_editor = CodeMirror.fromTextArea(elm[0], {lineNumbers: true, matchBrackets: true, indentUnit: 4, mode: "text/x-mysql"}); } })