Workaround for indexing bug with bad UTF-8 past maxLength
I'll put in a better fix on master, though this shouldn't happen anyway, since nsIConverterInputStream shouldn't be throwing.
This commit is contained in:
parent
10cef4c06f
commit
83c391628d
1 changed files with 8 additions and 1 deletions
|
@ -376,7 +376,14 @@ Zotero.Fulltext = new function(){
|
|||
|
||||
// Record number of characters indexed
|
||||
if (!isCacheFile) {
|
||||
var totalChars = this.getTotalCharsFromFile(itemID);
|
||||
try {
|
||||
var totalChars = this.getTotalCharsFromFile(itemID);
|
||||
}
|
||||
catch (e) {
|
||||
Zotero.debug(e);
|
||||
Components.utils.reportError(e);
|
||||
totalChars = 0;
|
||||
}
|
||||
if (maxLength) {
|
||||
var charsIndexed = Math.min(maxLength, totalChars);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue