GitHub Issue | n/a |
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-10-11T23:28:39.000+0000 |
Affected Version/s | Release 1.8.3 |
Fix Version/s | Release 3.0.0, Release 3.1.0, 2012 Sprint 21 API, 2012 Sprint 21 |
Components | Android |
Labels | api, qe-testadded |
Reporter | Josh Roesslein |
Assignee | Josh Roesslein |
Created | 2012-09-22T14:21:09.000+0000 |
Updated | 2013-10-07T09:11:20.000+0000 |
Firing an event from a WebView will cause a crash if the event object
contains a null value. This is due to how we bridge the object between Java <-> WebView
as a JSON string. We do not properly convert JSONObject.NULL values back to Java nulls
which causes our Kroll layer to crash since it can't convert this type.
Test Case
1. Create an application with the attached app.js and index.html.
2. Click the button in the web view ("click me") to trigger an event.
Pass: alert appears displaying the event object.
Fail: application crashes due to conversion error ("Unable to convert unknown Java object class 'org.json.JSONObject$1' to Js value")
Credit
Thanks to Tristan Waddington for reporting this bug and the detailed write up on his blog.
Created [PR #3032](https://github.com/appcelerator/titanium_mobile/pull/3032) to resolve issue.
Updated app.js to fix crash seen when running on Rhino.
backport PR https://github.com/appcelerator/titanium_mobile/pull/3174
Tested with 3.0.0.20121204144658 on Droid 1 2.2.3 with Rhino and V8