Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-25192] Evaluating a null value in async crashes app #204

Merged
merged 1 commit into from Sep 15, 2017
Merged

[TIMOB-25192] Evaluating a null value in async crashes app #204

merged 1 commit into from Sep 15, 2017

Conversation

infosia
Copy link
Contributor

@infosia infosia commented Aug 31, 2017

TIMOB-25192

Evaluating .NET null value in async crashes app.

var win = Ti.UI.createWindow({ backgroundColor: 'green' });
var PopupMenu = require('Windows.UI.Popups.PopupMenu');
var UICommand = require('Windows.UI.Popups.UICommand');
var Point = require('Windows.Foundation.Point');

var menu = new PopupMenu();
var alertHiCommand = new UICommand("Hi!");
var alertByeCommend = new UICommand("Bye!");

var commands = menu.Commands;
commands.Add(alertHiCommand);
commands.Add(alertByeCommend);

function popupMenu(e) {
    var p = new Point(e.y, e.x);
    menu.ShowAsync(p).then(function (selectedCommand) {
        if (selectedCommand == null) {
            alert('nothing selected');
        } else {
            alert(selectedCommand.Label);
        }
    }, function (err) { alert(err) });
}

win.addEventListener('click', function (e) {
    popupMenu(e);
});

win.open();

Expected: No crash when you click app window (popup appears) and then you should be able to click elsewhere to cancel popup.

Copy link
Contributor

@garymathews garymathews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR: PASS

@infosia infosia merged commit 90eec54 into tidev:master Sep 15, 2017
@infosia infosia deleted the TIMOB-25192 branch September 15, 2017 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants