Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25192] Windows: Evaluating a null value from Hyperloop crashes the App

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2017-09-25T12:00:04.000+0000
Affected Version/sHyperloop 2.1.3
Fix Version/sHyperloop 2.2.0
ComponentsHyperloop, Windows
Labelsn/a
ReporterVictor Vazquez Montero
AssigneeKota Iguchi
Created2017-08-24T17:55:27.000+0000
Updated2017-11-07T01:23:02.000+0000

Description

Description

When evaluating a .NET's null value retrieved using Hyperloop (Windows; Hyperloop version 2.1.1) , the application crashes. Take for instance:
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)
	{
		alert(selectedCommand);
	}, function(err) {alert(err)});
}
If no command was selected, the application crashes. Otherwise, it works as expected.

Comments

  1. Kota Iguchi 2017-08-31

    https://github.com/appcelerator/hyperloop.next/pull/204
  2. Kota Iguchi 2017-09-25

  3. Ewan Harris 2017-10-03

    Verified ticket in Hyperloop 2.2.0 evaluating null no longer crashes the application Studio: 4.10.0.201709271713 SDK: 6.2.2.GA, 6.3.0.v20170929040536 Appc NPM: 4.2.9 Appc CLI: 6.2.4 Hyperloop: 2.2.0RC2
  4. Kota Iguchi 2017-11-07

    [~vvazquezmontero] How about this? Expected: No crash when you click app window (popup appears) and then you should be able to click elsewhere to cancel popup.
       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();
       

JSON Source