diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js index ed3893690e..565b93c2a5 100644 --- a/chrome/content/zotero/xpcom/translation/translate.js +++ b/chrome/content/zotero/xpcom/translation/translate.js @@ -1871,7 +1871,8 @@ Zotero.Translate.Base.prototype = { var elem = index ? docOrElem.querySelectorAll(selector).item(index) : docOrElem.querySelector(selector); - return (elem ? elem.getAttribute(attr) : "").trim(); + if (!elem) return ""; + return (elem.hasAttribute(attr) ? elem.getAttribute(attr) : "").trim(); }, /**