Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2357] Android: Properties API getBool(), getInt() and getDouble() cause NPE

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:58:52.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.5.0 M02
ComponentsAndroid
Labelsandroid, defect
ReporterBill Dawson
AssigneeBill Dawson
Created2011-04-15T03:17:38.000+0000
Updated2011-04-17T01:58:53.000+0000

Description

Simple app.js:

Titanium.UI.setBackgroundColor('#000');
Ti.App.Properties.setInt('MyVal', 5);
Ti.App.Properties.getInt('MyVal');
Ti.App.Properties.setDouble('MyValD', 5.0);
Ti.App.Properties.getDouble('MyValD');
Ti.App.Properties.setBool('MyValB', true);
Ti.App.Properties.getBool('MyValB');

Trace:

E/KrollContext(  594): Caused by: java.lang.NullPointerException
E/KrollContext(  594):  at ti.modules.titanium.app.properties.PropertiesModule.getInt(PropertiesModule.java:74)
E/KrollContext(  594):  at ti.modules.titanium.app.properties.PropertiesModuleBindingGen$4.invoke(PropertiesModuleBindingGen.java:218)
E/KrollContext(  594):  at org.appcelerator.kroll.KrollMethod.call(KrollMethod.java:46)
E/KrollContext(  594):  ... 13 more

Comments

  1. Bill Dawson 2011-04-15

    (from [1730abde77b2302e7d94e842bc94b52611a09f7c]) [#2357 state:fixed-in-qa] Don't pass nulls to TiProperties methods that use primitives, because they get passed on to android native methods that expect primitives. https://github.com/appcelerator/titanium_mobile/commit/1730abde77b2302e7d94e842bc94b52611a09f7c"> https://github.com/appcelerator/titanium_mobile/commit/1730abde77b2...

  2. Matt Schmulen 2011-04-15

    pass android 2.1 Sim, Titanium SDK version: 1.5.0 (11/24/10 12:05 c0aff27)

  3. Matt Schmulen 2011-04-15

    pass android 1.6 sim, Titanium SDK version: 1.5.0 (11/24/10 12:05 c0aff27)

JSON Source