commit 83c391628d4fb23e0407d46a9b9f320ff04bd52a
parent 10cef4c06fdfca4d758996b3255711fa293534fc
Author: Dan Stillman <dstillman@zotero.org>
Date: Mon, 13 Feb 2012 16:24:51 -0500
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.
Diffstat:
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/chrome/content/zotero/xpcom/fulltext.js b/chrome/content/zotero/xpcom/fulltext.js
@@ -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);
}