diff --git a/chrome/content/zotero/standalone/standalone.js b/chrome/content/zotero/standalone/standalone.js index bfaa941c72..4b0202ef4d 100644 --- a/chrome/content/zotero/standalone/standalone.js +++ b/chrome/content/zotero/standalone/standalone.js @@ -161,7 +161,12 @@ const ZoteroStandalone = new function() { if (format.mode == 'export') { try { let obj = Zotero.Translators.get(format.id); - copyExport.label = Zotero.getString('quickCopy.copyAs', obj.label); + if (obj) { + copyExport.label = Zotero.getString('quickCopy.copyAs', obj.label); + } + else { + copyExport.hidden = true; + } } catch (e) { if (!(e instanceof Zotero.Exception.UnloadedDataException && e.dataType == 'translators')) { diff --git a/chrome/content/zotero/xpcom/quickCopy.js b/chrome/content/zotero/xpcom/quickCopy.js index 5bd968bf87..cde60d04ec 100644 --- a/chrome/content/zotero/xpcom/quickCopy.js +++ b/chrome/content/zotero/xpcom/quickCopy.js @@ -182,7 +182,8 @@ Zotero.QuickCopy = new function() { } if (!_siteSettings) { - throw new Zotero.Exception.UnloadedDataException("Quick Copy site settings not loaded"); + Zotero.debug("Quick Copy site settings not loaded", 2); + return quickCopyPref; } var matches = []; @@ -461,6 +462,10 @@ Zotero.QuickCopy = new function() { Zotero.debug(`Preloading ${format.id} for Quick Copy`); await Zotero.Translators.init(); let translator = Zotero.Translators.get(format.id); + if (!translator) { + Zotero.logError(`Translator ${format.id} not found`); + return; + } translator.cacheCode = true; await translator.getCode(); }