Skip to content

Commit

Permalink
Fixing issue in simplePath lookup for single attributes, when no elem…
Browse files Browse the repository at this point in the history
…ent is found.
  • Loading branch information
constantinius committed Feb 27, 2018
1 parent 0e01acb commit 5896a53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export function simplePath(element, path, single = false) {
const [namespace, tagName] = splitNamespace(nodePart);
const [attrNamespace, attrName] = splitNamespace(attrPart);
current = getFirstElement(current, namespace, tagName);
return getAttributeNS(current, attrNamespace, attrName);
return current ? getAttributeNS(current, attrNamespace, attrName) : null;
}
const [namespace, tagName] = splitNamespace(part);
current = getFirstElement(current, namespace, tagName);
Expand Down

0 comments on commit 5896a53

Please sign in to comment.