Problem description
Boolean functions like getVisible() or getEnabled() can return null value
Code sample
var win = Ti.UI.createWindow({
exitOnClose:true
});
var view = Ti.UI.createView({
top:0,
left:0,
width: 10,
height:10
});
var button = Ti.UI.createButton({
title:'Click Me!'
});
button.addEventListener('click', function(e) {
alert(view.getVisible());
Ti.
view.setVisible(!view.getVisible());
});
win.add(button);
win.add(view);
win.open();
Result: After running the sample code, click on the button to execute view.getVisible(), which return value 'null'.
Expected result: If the property was never defined by the user, then the default value should be returned.
This works correctly for me if I change the line Ti.view.setVisible(!view.getVisible()); to view.setVisible(!view.getVisible());
This works if I change the line Ti.view.setVisible(!view.getVisible()); to view.setVisible(!view.getVisible());
Closing ticket as I am unable to reproduce the issue using the following environment; Pixel (7.1) MacOS 10.11.6 (15G31) Studio 4.8.1.201612050850 Ti SDK 6.0.3 GA Appc NPM 4.2.8 Appc CLI 6.1.0 Ti CLI 5.0.11 Alloy 1.9.5 Arrow 1.10.1 Xcode 8.2 (8C38) Node v4.6.0 Java 1.7.0_80