Browse Source

HUE-3858 [editor] Js error on very first opening of the editor

Enrico Berti 9 years ago
parent
commit
94b494a

+ 1 - 1
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -689,7 +689,7 @@
     };
 
     self.formatEnabled = ko.pureComputed(function () {
-      return self.statement_raw && self.statement_raw().length < 400000; // ie: 5000 lines at 80 chars per line
+      return self.statement_raw && self.statement_raw() != null && self.statement_raw().length < 400000; // ie: 5000 lines at 80 chars per line
     });
 
     self.format = function () {