www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 82411490795c1a6a2b88e640a3ba1effea4dacff
parent d45a9c22c57144e4195e47096299f0aa97ece0ec
Author: Dan Stillman <dstillman@zotero.org>
Date:   Wed, 22 Nov 2017 04:22:08 -0500

Fix sync error if item with no content type somehow was indexed

https://forums.zotero.org/discussion/68954/mimetype-is-undefined-error

Not sure how this could happen.

Diffstat:
Mchrome/content/zotero/xpcom/fulltext.js | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/chrome/content/zotero/xpcom/fulltext.js b/chrome/content/zotero/xpcom/fulltext.js @@ -849,7 +849,7 @@ Zotero.Fulltext = Zotero.FullText = new function(){ let item = yield Zotero.Items.getAsync(itemID); let libraryKey = item.libraryKey; let contentType = item.attachmentContentType; - if (isCachedMIMEType(contentType) || Zotero.MIME.isTextType(contentType)) { + if (contentType && (isCachedMIMEType(contentType) || Zotero.MIME.isTextType(contentType))) { try { let cacheFile = this.getItemCacheFile(item).path; if (yield OS.File.exists(cacheFile)) { @@ -904,7 +904,7 @@ Zotero.Fulltext = Zotero.FullText = new function(){ } else { Zotero.debug("Skipping non-text file getting full-text content for item " - + libraryKey, 2); + + `${libraryKey} (contentType: ${contentType})`, 2); // Delete rows for items that weren't supposed to be indexed yield Zotero.DB.executeTransaction(function* () {