Title:
Null Pointer Exception sometimes caused by function expression (closure) inside literal struct
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Peter Boughton / Peter Boughton (Peter Boughton)
Created: 03/11/2015
Components: Language
Versions: 11.0
Failure Type: Non Functioning
Found In Build/Fixed In Build: CF11_Final /
Priority/Frequency: Major / All users will encounter
Locale/System: ALL / Platforms All
Vote Count: 1
The code worked fine on CF11 u2.
Testing CF11 u5 pre2 and it gives a Null Pointer Exception - sometimes. Sometimes it works fine - just refreshing the page results in different behaviour with no code changes, which is REALLY AWESOME! ¬_¬
Stack trace:
java.lang.NullPointerException
at coldfusion.runtime.CFPage.URLEncodedFormat(CFPage.java:4140)
at cfShareUtils2ecfc639456635$func_CF_ANONYMOUSCLOSURE_3.runFunction(<path>\ShareUtils.cfc:40)
at coldfusion.runtime.Closure.invoke(Closure.java:100)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:231)
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2845)
at cfShareUtils2ecfc639456635$funcGETSHARETO.runFunction(<path>\ShareUtils.cfc:117)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:231)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:643)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:432)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:402)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2483)
Line 40 of ShareUtils.cfc is this:
& '?url=' & UrlEncodedFormat(PageUrl)
In context it is in the twitter function below:
variables.ShareUrls =
{ 'facebook': function(PageUrl) // no support for ShareText
{
return 'http://www.facebook.com/sharer.php'
& '?u=' & UrlEncodedFormat(PageUrl)
;
}
//...
, 'twitter': function(PageUrl,ShareText)
{
return 'https://twitter.com/share'
& '?url=' & UrlEncodedFormat(PageUrl)
& '&text=' & UrlEncodedFormat(ShareText)
;
}
//...
};
Of course all that formatting is about to be lost because this bugbase software is shit and Adobe can't be bothered to fix it (3840576)
Not sure there's any point creating a reproducible test case since you'll just ignore it and use your own version that "pretty much does the same thing". :/
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3951546
External Customer Info:
External Company:
External Customer Name: Peter
External Customer Email:
Attachments:
- March 13, 2015 00:00:00: 1_test_3951546.zip
Comments: