groovy exception
I'm trying check if a container is present or not in groovy script but it's throwing null pointer exception I'm handling that as below,
getPage(parent).recurse {
page ->
def content = page.node
def property = content.get('sling:resourceType')
if (property == "project/components/product-page") {
count++;
println page.path;
def footercontainer = getNode(page.path+"/jcr:content/root/container_1845659030");
def refcontainer = getNode(page.path+refNode);
if(getNode(page.path+footercontainer) != null){
if(footercontainer.hasProperty(propName1)){
(footercontainer).getProperty(propName1).remove();
}
}

