alibaba82
16 years agoSuper Contributor
Checking for null reponse via groovy
I have a groovy scripts that looks like
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def holder = groovyUtils.getXmlHolder( "GetRecommendationItemsInList - Programs#Response" )
However, if the response is null, as in the case of a socket timeout, the above code fails with a null pointer exception.
How can I check for a null response so I can write something like
if (response != null)
{
do some stuff
}
else
do some other stuff
Thanks
Ali
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def holder = groovyUtils.getXmlHolder( "GetRecommendationItemsInList - Programs#Response" )
However, if the response is null, as in the case of a socket timeout, the above code fails with a null pointer exception.
How can I check for a null response so I can write something like
if (response != null)
{
do some stuff
}
else
do some other stuff
Thanks
Ali