[TIMOB-2357] Android: Properties API getBool(), getInt() and getDouble() cause NPE
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:58:52.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.5.0 M02 |
Components | Android |
Labels | android, defect |
Reporter | Bill Dawson |
Assignee | Bill Dawson |
Created | 2011-04-15T03:17:38.000+0000 |
Updated | 2011-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
(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...
pass android 2.1 Sim, Titanium SDK version: 1.5.0 (11/24/10 12:05 c0aff27)
pass android 1.6 sim, Titanium SDK version: 1.5.0 (11/24/10 12:05 c0aff27)