From f9b074496fae87e095bd8c79e79dd497819cab8c Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Sun, 10 Jul 2011 22:55:27 +0000 Subject: [PATCH] Better error for unsupported translator --- chrome/content/zotero/xpcom/translation/translate.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js index 26e39b363..b24644adf 100644 --- a/chrome/content/zotero/xpcom/translation/translate.js +++ b/chrome/content/zotero/xpcom/translation/translate.js @@ -944,6 +944,12 @@ Zotero.Translate.Base.prototype = { * Called when translator has been retrieved and loaded */ "_translateTranslatorLoaded":function() { + if(!this.translator[0].code) { + this.complete(false, + new Error("Translator "+this.translator[0].label+" is unsupported within this environment")); + return; + } + // set display options to default if they don't exist if(!this._displayOptions) this._displayOptions = this.translator[0].displayOptions;