Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18135] iOS: App is crashing for null check in JavaScript variables

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2014-12-07T23:35:00.000+0000
Affected Version/sRelease 3.5.0
Fix Version/sRelease 3.5.0, Release 4.0.0
ComponentsiOS
Labelsqe-3.5.0, qe-assigned, regression
ReporterKajenthiran Velummaylum
AssigneeVishal Duggal
Created2014-12-04T05:53:24.000+0000
Updated2014-12-09T23:16:25.000+0000

Description

Titanium Apps are crashing when object null checks are used inside app.js file. This is a *regression* since same code works fine in 3.4.1

Steps To Reproduce

1. Create an app using following code
var b = null;
if (b != null) 
{ 
	// do something
}
2. Run the App in iOS device with 3.5.0 SDK

Actual Result

App is crashing

Expected Result

App should not crash.

Comments

  1. Ingo Muschenetz 2014-12-04

    Is this a duplicate of TIMOB-18118?
  2. Kajenthiran Velummaylum 2014-12-04

    Following codes are not crashing
       //code 1
       var b = 1;
       if (b != null) 
       { 
           // do something
       }
       
       //code 2
       var b = null;
       if (b == null) 
       { 
           // do something
       }
       
    Use cases: KitchenSink -> Base UI -> Window (Standalone) is crashing for same reason with 3.5.0 SDK
  3. Kajenthiran Velummaylum 2014-12-04

    Yes [~ingo] It's a duplicate of TIMOB-18118 In TIMOB-18118, It's crashing in the same syntax. Following is the actual code of crash in the ticket
       if (null != b && null != e) // It crashes in this line if either 'b' or 'e' is null.
               // some code here
       
  4. Eric Wieber 2014-12-09

    Verified fixed using: Titanium SDK 3.5.0.v20141208122514 Studio 3.4.1.201410281743 Xcode 6.1.1 On: iPad mini, iOS 8.1 iPhone 6, iOS 8.2b iPhone 4S Sim, iOS 8.1

JSON Source