[TIMOB-14717] BlackBerry: Crash with Ti.App.Properties.getString()
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2013-07-31T16:02:25.000+0000 |
Affected Version/s | Release 3.1.1 |
Fix Version/s | n/a |
Components | BlackBerry |
Labels | blackberry, crash, properties |
Reporter | Brent Barbata |
Assignee | Pedro Enrique |
Created | 2013-07-30T23:08:08.000+0000 |
Updated | 2017-03-16T20:25:49.000+0000 |
Description
The following line (alone) will crash the BlackBerry simulator if the property cannot be found. (In this case, the property name is "Credentials".)
var storedCredentials = JSON.parse(Ti.App.Properties.getString("Credentials"));
However, if we set the property/value pair using setString() and then try getString(), everything works fine. For example, this will work:
// Build json string
oCredentials = new Object();
oCredentials.username = "some username";
oCredentials.password = "some password";
var stringCredentials = JSON.stringify(oCredentials);
// Save credentials
Ti.App.Properties.setString("Credentials", stringCredentials);
// Read the credentials
var storedCredentials = JSON.parse(Ti.App.Properties.getString("Credentials"));
I do not see a crash, I see message
This appears when trying to JSON.stringify an undefined value. Same thing happens in a node.js console:
Closing ticket as BlackBerry is no longer supported by us.