[TIMOB-11709] Android: String.formatTime causes app crash when date is string.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-11-14T21:38:14.000+0000 |
Affected Version/s | Release 2.1.3 |
Fix Version/s | Release 3.0.2, Release 7.0.0 |
Components | Android |
Labels | parity, qe-3.2.1 |
Reporter | Amuktha Akkinepally |
Assignee | Maggie Chen |
Created | 2012-11-08T22:20:47.000+0000 |
Updated | 2017-11-15T07:01:08.000+0000 |
Description
When the date is a random string rather than a function(Date()) then String.formatTime causes app crash. It just gives a null output on iOS and does not crash.
Steps to reproduce:
1. Load the below app.js 2. Test it on both iOS and Android. Expected Result: On Android, the output should be null or should throw an exception. Actual Result: The App crashes on Android.
var win = Ti.UI.createWindow({
backgroundColor:'white'
});
win.addEventListener('click', function() {
var date = "GIBBERISH";
//var date = new Date();
alert( String.formatTime(date) );
});
win.open();
Issue does not reproduces with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 (03/11/13 15:43 0c88429) Titanium SDK version: 3.0.2 (02/07/13 16:46 a4def81) Device: Samsung galaxy s duos Android version: 4.0.4 jithinpv
This issue is still reproducible. The app crashes on android 2.3.7, 4.1.1, 4.2.2. But does not crash on android 4.4.2 & 4.3. Might be a regression, dont have the fix built to test though. Reopening. Environment: Appc Studio : 3.2.1.201401281409 Ti SDK : 3.2.1.v20140130101648 Mac OSX : 10.8.5 Alloy : 1.3.1-cr CLI - 3.2.1 beta3
Moving this out of 6.2.0. A more general type-mismatching handling during build time should cover it and similar cases.
PR https://github.com/appcelerator/titanium_mobile/pull/9572
FR Passed. Waiting for merge to get enabled.
PR Merged.
Changes are seen in SDK 7.0.0.v20171114203226.