Fix bundled attr() when attribute doesn't exist

Regression from 4efc0af119
This commit is contained in:
Dan Stillman 2020-10-05 23:36:06 -04:00
parent bb44841a80
commit d3c481fcf6

View file

@ -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();
},
/**