Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10255] Blackberry: Titanium.App.Properties - Cannot convert types.

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2013-02-10T07:17:25.000+0000
Affected Version/sn/a
Fix Version/sRelease 3.1.0, 2013 Sprint 03 BB, 2013 Sprint 03
ComponentsBlackBerry
Labelsn/a
ReporterHayk Zakaryan
AssigneeJosh Roesslein
Created2012-07-31T07:06:20.000+0000
Updated2017-03-08T18:05:03.000+0000

Description

If some Int property is set like Titanium.App.Properties.setInt('Int',10) and than further trying to get it like this Titanium.App.Properties.getString('Int') (with getString()) It crashes - code which is below is not working. When trying to get as Titanium.App.Properties.getInt('Int') - it is fine The same is for Titanium.App.Properties.getString('Bool') and Titanium.App.Properties.getString('Double')- if you have set 'Bool' as setBool() and 'Double' as setDouble('Double',10.6); Also for setXXX method Titanium.App.Properties.setString('String',null) is crashing In the logs found this message - 'Invalid argument: expected String' This was tested on Blackberry emulator. KitchenSink -> Platform Tab->Properties API. File - Resources\ui\common\platform\properties.js (Lines 84-86, 106)

Comments

  1. David Lifshitz 2012-08-15

    Also should fix Ti.App, etc to inherit from TiProxy instead of TiObject and uncomment the stuff in KitchenSink.
  2. Jean-Philippe Lemieux 2012-08-22

    Getters should try to convert the value if possible
  3. Jean-Philippe Lemieux 2012-08-22

    {quote} Also for setXXX method Titanium.App.Properties.setString('String',null) is crashing In the logs found this message - 'Invalid argument: expected String' {quote} This test case doesn't seem valid as null is not a String so the raised exception seems to be right.
  4. Hayk Zakaryan 2012-08-23

    Tested Titanium.App.Properties.setString('String',null) on Android and correspondingly Titanium.App.Properties.getString('String'). Both of them worked without raising exception. Getter returned null.
  5. Hayk Zakaryan 2012-08-23

    Also tested on Android: Titanium.App.Properties.setInt('int',15); and tried to get with getDouble() Titanium.App.Properties.getDouble('int'); Worked normally and returned 15.
  6. Josh Roesslein 2013-02-06

    Created pull request [#23](https://github.com/appcelerator/titanium_mobile_blackberry/pull/23) to resolve issue.
  7. Lee Morris 2017-03-08

    Closing ticket as resolved.

JSON Source