diff --git a/chrome/content/zotero/xpcom/fulltext.js b/chrome/content/zotero/xpcom/fulltext.js index 2e93d7751..8069beadd 100644 --- a/chrome/content/zotero/xpcom/fulltext.js +++ b/chrome/content/zotero/xpcom/fulltext.js @@ -502,7 +502,7 @@ Zotero.Fulltext = new function(){ } - function indexItems(items, complete) { + function indexItems(items, complete, ignoreErrors) { if (items.constructor.name != 'Array') { items = [items]; } @@ -522,7 +522,19 @@ Zotero.Fulltext = new function(){ continue; } - this.indexFile(file, i.attachmentMIMEType, i.attachmentCharset, i.id, !complete); + if (ignoreErrors) { + try { + this.indexFile(file, i.attachmentMIMEType, i.attachmentCharset, i.id, !complete); + } + catch (e) { + Zotero.debug(e, 1); + Components.utils.reportError("Error indexing " + file.path); + Components.utils.reportError(e); + } + } + else { + this.indexFile(file, i.attachmentMIMEType, i.attachmentCharset, i.id, !complete); + } } Zotero.DB.commitTransaction(); @@ -902,7 +914,7 @@ Zotero.Fulltext = new function(){ if (items) { Zotero.DB.query("DELETE FROM fulltextItemWords WHERE itemID IN (" + sql + ")"); Zotero.DB.query("DELETE FROM fulltextItems WHERE itemID IN (" + sql + ")"); - this.indexItems(items); + this.indexItems(items, false, true); } Zotero.DB.commitTransaction(); }