Skip to content

Commit

Permalink
Added an additional check (#7)
Browse files Browse the repository at this point in the history
* cleanup
* added additional check of node on line 248
  • Loading branch information
ianmichell authored and bikerp committed Feb 1, 2017
1 parent 6ddba8a commit 1c422e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
results.txt
result.txt
.vscode
3 changes: 2 additions & 1 deletion js/soapclient.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ function readResponseValue(body, elementName) {
if (body && elementName) {
var doc = new DOMParser().parseFromString(body);
var node = doc.getElementsByTagName(elementName).item(0);
return (node) ? node.firstChild.nodeValue : "ERROR";
// Check that we have children of node.
return (node && node.firstChild) ? node.firstChild.nodeValue : "ERROR";
}
}

0 comments on commit 1c422e3

Please sign in to comment.