diff --git a/lib/ace/document.js b/lib/ace/document.js index ee0ce11f..bfd80de9 100644 --- a/lib/ace/document.js +++ b/lib/ace/document.js @@ -173,7 +173,7 @@ var Document = function(text) { }; this.insert = function(position, text) { - if (text.length == 0) + if (!text || text.length === 0) return position; position = this.$clipPosition(position);