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:
Dan Stillman 2012-02-13 16:24:51 -05:00
parent 10cef4c06f
commit 83c391628d

View file

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