John_R__Brewste
16 years agoOccasional Contributor
XmlHoder Null Pointer Exception
Greetings
I am running a GroovyScript that has the following code:
...
def holder = groovyUtils.getXmlHolder( it.name+"#Response" );
if (holder["//ns1:FunctionReturnCode"] == "SUCCESS") {
...
The issue is the #Response may or may not be there. Therefore I am getting a NullPointerException. This, for one, locks up my system for about 20 minutes while it does something ... However, I want to know how I can check for a valid response without getting a nullPointer?
Is there a check I can run. I looked at the API for xmlHoder but I cannot find anything.
Thanks,
Jb
I am running a GroovyScript that has the following code:
...
def holder = groovyUtils.getXmlHolder( it.name+"#Response" );
if (holder["//ns1:FunctionReturnCode"] == "SUCCESS") {
...
The issue is the #Response may or may not be there. Therefore I am getting a NullPointerException. This, for one, locks up my system for about 20 minutes while it does something ... However, I want to know how I can check for a valid response without getting a nullPointer?
Is there a check I can run. I looked at the API for xmlHoder but I cannot find anything.
Thanks,
Jb