NullPointerException parsing XML in 5.2.2.70-RC

In upgrading from Lucee 5.2.1.9 to either 5.2.2.68-RC or 5.2.2.70-RC, I get the following error message in a function that is trying to parse some XML. If I downgrade to 5.2.1.9, things work again without errors.

"Severity","ThreadID","Date","Time","Application","Message"
"ERROR","cfthread-0","07/21/2017","13:18:13","","cfthread-0;java.lang.NullPointerException;lucee.runtime.exp.NativeException: java.lang.NullPointerException
        at lucee.runtime.text.xml.XMLUtil.childNodesLength(XMLUtil.java:894)
        at lucee.runtime.text.xml.XMLNodeList.getLength(XMLNodeList.java:86)
        at lucee.runtime.text.xml.XMLNodeList.size(XMLNodeList.java:96)
        at lucee.runtime.functions.arrays.ArrayLen.call(ArrayLen.java:35)
        at server.somedir.mycode_cfc$cf.udfCall(/app/server/somedir/mycode.cfc:226)
        at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:107)
        at lucee.runtime.type.UDFImpl._call(UDFImpl.java:355)
        at lucee.runtime.type.UDFImpl.call(UDFImpl.java:226)
        at lucee.runtime.ComponentImpl._call(ComponentImpl.java:697)
        at lucee.runtime.ComponentImpl._call(ComponentImpl.java:580)
        at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1918)
        at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:758)
        at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1693)
        at server.somedir.downloadinfo_cfm$cf.call(/app/server/somedir/downloadinfo.cfm:157)
        at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:938)
        at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:838)
        at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:822)
        at server.demo.stepforward_cfm$cf.threadCall(/app/server/demo/stepforward.cfm:35)
        at lucee.runtime.thread.ChildThreadImpl.execute(ChildThreadImpl.java:205)
        at lucee.runtime.thread.ChildThreadImpl.run(ChildThreadImpl.java:148)
Caused by: java.lang.NullPointerException
        ... 20 more

Please open a ticket in JIRA and provide the information that you posted here. Thank you.

https://luceeserver.atlassian.net/

I coludn’t able to reproduce the issue in 5.2.2.70-RC version. XML parse works fine. I’ve added my test zip file in [LDEV-1430] - Lucee.

I added to the code you provided to reproduce the issue. The bug occurs when trying to use array related function on an XmlChildren node.

I had been using the xmlToStruct function (various versions at Converting XML to JSON - My exploration into madness... and GitHub - GiancarloGomez/XmlToStruct: Updated Script CFC which was originally written by Anuj Gakhar - http://xml2struct.riaforge.org/) , which I imagine some other CF developers are also using.

FYI, this issue occurred before in a much older build and then disappeared in a release version. It seems to have cropped up once more in these builds…

Thanks,
C

Thanks for the speedy fix! Works beautifully now!