From 6c593e5b3249cf438979c46ed9382fdec34ea460 Mon Sep 17 00:00:00 2001 From: =?utf8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Mon, 15 Apr 2019 13:04:51 +0200 Subject: [PATCH] Make sure we have a proper node before parsing MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- core/js/files/iedavclient.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/js/files/iedavclient.js b/core/js/files/iedavclient.js index 4e2c17abc55..ecf1d1bb660 100644 --- a/core/js/files/iedavclient.js +++ b/core/js/files/iedavclient.js @@ -82,6 +82,11 @@ var parts = name.split(':'); var tagName = parts[1]; var namespace = resolver(parts[0]); + // make sure we can get elements + if (typeof node === 'string') { + var parser = new DOMParser() + node = parser.parseFromString(node, 'text/xml') + } if (node.getElementsByTagNameNS) { return node.getElementsByTagNameNS(namespace, tagName); } -- 2.39.5