From 83c391628d4fb23e0407d46a9b9f320ff04bd52a Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 13 Feb 2012 16:24:51 -0500 Subject: [PATCH] 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. --- chrome/content/zotero/xpcom/fulltext.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/fulltext.js b/chrome/content/zotero/xpcom/fulltext.js index 2796fc1199..2e93d77511 100644 --- 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); }