Skip to content
Snippets Groups Projects
Verified Commit b164be16 authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

fix: check is attribute set

parent 779a29cb
No related branches found
No related tags found
No related merge requests found
...@@ -291,6 +291,7 @@ function retrieveAndSetValue(element) { ...@@ -291,6 +291,7 @@ function retrieveAndSetValue(element) {
const pathfinder = new Pathfinder(self[internalSymbol].subject.getSubject()); const pathfinder = new Pathfinder(self[internalSymbol].subject.getSubject());
let path = element.getAttribute(ATTRIBUTE_UPDATER_BIND); let path = element.getAttribute(ATTRIBUTE_UPDATER_BIND);
if (path === null) throw new Error("the bind argument must start as a value with a path");
if (path.indexOf("path:") !== 0) { if (path.indexOf("path:") !== 0) {
throw new Error("the bind argument must start as a value with a path"); throw new Error("the bind argument must start as a value with a path");
...@@ -434,6 +435,8 @@ function insertElement(change) { ...@@ -434,6 +435,8 @@ function insertElement(change) {
found = true; found = true;
const attributes = containerElement.getAttribute(ATTRIBUTE_UPDATER_INSERT); const attributes = containerElement.getAttribute(ATTRIBUTE_UPDATER_INSERT);
if (attributes === null) continue;
let def = trimSpaces(attributes); let def = trimSpaces(attributes);
let i = def.indexOf(" "); let i = def.indexOf(" ");
let key = trimSpaces(def.substr(0, i)); let key = trimSpaces(def.substr(0, i));
...@@ -489,6 +492,7 @@ function insertElement(change) { ...@@ -489,6 +492,7 @@ function insertElement(change) {
let nodes = containerElement.querySelectorAll( let nodes = containerElement.querySelectorAll(
`[${ATTRIBUTE_UPDATER_INSERT_REFERENCE}*="${refPrefix}"]`, `[${ATTRIBUTE_UPDATER_INSERT_REFERENCE}*="${refPrefix}"]`,
); );
for (const [, node] of Object.entries(nodes)) { for (const [, node] of Object.entries(nodes)) {
if (!available.has(node.getAttribute(ATTRIBUTE_UPDATER_INSERT_REFERENCE))) { if (!available.has(node.getAttribute(ATTRIBUTE_UPDATER_INSERT_REFERENCE))) {
try { try {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment