Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11709] Android: String.formatTime causes app crash when date is string.

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2017-11-14T21:38:14.000+0000
Affected Version/sRelease 2.1.3
Fix Version/sRelease 3.0.2, Release 7.0.0
ComponentsAndroid
Labelsparity, qe-3.2.1
ReporterAmuktha Akkinepally
AssigneeMaggie Chen
Created2012-11-08T22:20:47.000+0000
Updated2017-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();

Comments

  1. jithinpv 2013-03-18

    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
  2. Lokesh Choudhary 2014-01-31

    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
  3. Yordan Banev 2017-08-17

    Moving this out of 6.2.0. A more general type-mismatching handling during build time should cover it and similar cases.
  4. Maggie Chen 2017-11-07

    PR https://github.com/appcelerator/titanium_mobile/pull/9572
  5. Lokesh Choudhary 2017-11-14

    FR Passed. Waiting for merge to get enabled.
  6. Lokesh Choudhary 2017-11-14

    PR Merged.
  7. Abir Mukherjee 2017-11-15

    Changes are seen in SDK 7.0.0.v20171114203226.

JSON Source