[ http://issues.apache.org/jira/browse/COCOON-1886?page=comments#action_12424458 ] Mark Lundquist commented on COCOON-1886: ----------------------------------------
Well... I tried the code example provided in the description as a test case (except that as written there it is missing the call to inner()), and the NPE didn't happen, so I'm closing this, and if I ever see something like it again I'll try and debug it some more and come up with a real test case (or more likely, figure out what I was doing wrong :-/) > NPE when attempting to access cocoon.request from within a nested JS function > ----------------------------------------------------------------------------- > > Key: COCOON-1886 > URL: http://issues.apache.org/jira/browse/COCOON-1886 > Project: Cocoon > Issue Type: Bug > Components: - Flowscript > Affects Versions: 2.1.8 > Reporter: Mark Lundquist > Priority: Minor > > ? Confirmed in 2.1.8; probably affects subsequent versions as well > ? Prioritized as "minor" because it can be worked around in most cases > This causes an NPE: > function outer() { > function inner() { > var x = cocoon.request; > } > } > java.lang.NullPointerException > at > org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon.jsGet_request(FOM_Cocoon.java:574) > at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:324) > at > org.mozilla.javascript.ScriptableObject.getByGetter(ScriptableObject.java:200) > etc... -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
