Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-25013

Windows: Asserting the value returned from getPersonByIdentifier crashes an application

    Details

      Description

      Description

      When performing a not null assertion on a person value returned from a getPersonByIdentifier call the application will crash, the second assertion where the person does not exist works fine

      You can use https://github.com/ewanharris/mocha-test to test this, paste the code below and then click the blue label

      var window = Ti.UI.createWindow();
      // create a person
      var lbl = Ti.UI.createLabel({
      	backgroundColor: 'blue',
      	width: 400
      })
      window.add(lbl)
      lbl.addEventListener('click', function(e){
      	var person = Ti.Contacts.createPerson({
      		firstName: 'Arthur',
      		lastName: 'Evans'
      	});
      	Ti.Contacts.save();
      	// Query for person we created
      	var queriedPerson = Ti.Contacts.getPersonByIdentifier(person.identifier);
      	should(queriedPerson).not.be.null;
      	should(queriedPerson.firstName).be.eql(person.firstName);
      	should(queriedPerson.lastName).be.eql(person.lastName);
      	should(queriedPerson.identifier).be.eql(person.identifier);
      	// remove the person
      	Ti.Contacts.removePerson(queriedPerson);
      	Ti.Contacts.save();
      	// Make sure they got removed
      	queriedPerson = Ti.Contacts.getPersonByIdentifier(person.identifier);
      	should(queriedPerson).be.null;
      })
      window.open();
      

      Steps to reproduce
      1. Paste the code above into the mocha-test app
      2. Run the app to a Windows target
      3. Tap the blue button
      Actual

      App crashes

      Expected

      App should not crash

        Attachments

          Activity

            People

            • Assignee:
              kiguchi Kota Iguchi
              Reporter:
              eharris Ewan Harris
              Reviewer:
              Gary Mathews
              Tester:
              Josh Longton
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-10925
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code