Closed hahagu closed 3 years ago
From the readme:
Also note that your preference keys cannot be null or "" (empty string).
So if you are in fact trying to use it with a null key, all bets are off. Essentially, this is undefined behavior. That said, we have checks for this. Are you sure it is failing silently? Passing null as a key should throw IllegalArgumentException
. It does not throw RemotePreferenceAccessException
because it is an incorrect usage of the API, not an expected failure condition of RPC.
Hmm.. I did not check if it throws the IllegalArgumentException
.
I guess there should be additional checks in place to catch null
exception in my own code.
Thanks for pointing me to the right direction.
If RemotePreferences is called upon a nulled object reference, such as:
This above code fails silently. The fail message does not show up, and the last line,
Log.d(prefValue);
does not even reach, but without any errors on the logcat.