Skip to content

Commit

Permalink
fix npe
Browse files Browse the repository at this point in the history
  • Loading branch information
lmillergithub committed Jan 17, 2024
1 parent 236575c commit aa2121d
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,13 @@ private String buildEnvelope(Definition definition, String operationName, boolea
// go through all main elements
for (int i = 1; i < schema.getElement().getChildNodes().getLength(); i += 2) {
Node node = schema.getElement().getChildNodes().item(i);
String name = node.getAttributes().getNamedItem("name") != null ? node.getAttributes().getNamedItem("name").getNodeValue() : null;

String name = "";
try {
name = node.getAttributes().getNamedItem("name").getNodeValue();
} catch (Exception e) {
name = null;
}

// go through child nodes of all elements related to operationName
if (StringUtils.equalsIgnoreCase(name, operationName)) {
while (node.getChildNodes().getLength() != 0) {
Expand Down

0 comments on commit aa2121d

Please sign in to comment.