diff --git a/source/dom/util/set-option-from-attribute.mjs b/source/dom/util/set-option-from-attribute.mjs index dd717e1eee33c07715c0c9fcd97be544add3595b..5f25721c5c419fd52b9fae1ae8554a7ed22e1745 100644 --- a/source/dom/util/set-option-from-attribute.mjs +++ b/source/dom/util/set-option-from-attribute.mjs @@ -49,6 +49,7 @@ function setOptionFromAttribute( mapping = {}, prefix = "data-monster-option-", ) { + if (!(element instanceof HTMLElement)) return options; if (!element.hasAttributes()) return options; @@ -84,4 +85,4 @@ function setOptionFromAttribute( finder.setVia(optionName, value); return options; -} +}