improved empty check
This commit is contained in:
parent
4113f574a4
commit
19a5af9fe3
1 changed files with 1 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue