Application.Storage.getValue not returning if key doesn't exist

i am using Application.Storage.getValue to retrieve settings stored by my application.

if the key doesn't exist, the function doesn't return.  I can get around this by putting intial get at end of application initialize function, but this obviously isn't the best.

Is there a way to establish whether a key exists or not?  I cannot find on in the SDK documentation.

  • I haven't had issues getValue() not returning if there is no key. As documented, in that case it'll return null.

    I think you should write bug report with code sample if you have way to reproduce this.

  • If the key doesn't exist, you'll get "null" back.  In the case of Application.Properties, you'll get a crash if the key doesn't exists, but there you can put the getValue() in a try/catch and recover.

    This is a case where code to reproduce the issue would be helpful, as what you're doing (trying to read a key from Storage that doesn't exist) is really common, as the first time an app runs, there's nothing in Storage.

    What device?  Some of the older ones don't support Application.Storage, but if they don't, the app should crash vs just never returning from the call.  If you're doing this in a background service, you might not see the crash in the sim, but on a real device, you'll see it in the ciq_log