improved empty check

This commit is contained in:
mikedeboer 2012-03-27 17:19:01 +02:00
commit 19a5af9fe3

View file

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