Problem: It seems that, under circumstances I do not understand, some NaN value gets passed to getState and then on to $tokenizeRows which causes empty array to be returned. getState then tries to access element 0 of this array and ugly things start to happen.
Solution: never return empty array from $tokenizeRows
This commit is contained in:
parent
25400848f2
commit
2fd1c7565b
1 changed files with 2 additions and 2 deletions
|
|
@ -130,8 +130,8 @@ var BackgroundTokenizer = function(tokenizer, editor) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$tokenizeRows = function(firstRow, lastRow) {
|
this.$tokenizeRows = function(firstRow, lastRow) {
|
||||||
if (!this.doc)
|
if (!this.doc || isNaN(firstRow) || isNaN(lastRow))
|
||||||
return [];
|
return [{'state':'start','tokens':[]}];
|
||||||
|
|
||||||
var rows = [];
|
var rows = [];
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue