There is an issue when using this library on Android, where the method private String sharedPreferences(ReadableMap options) might receive a null object for options. Thus, calling options.hasKey() on it will throw the following error:
Attempt to invoke interface method 'boolean com.facebook.react.bridge.ReadableMap. hasKey(java.lang.String)' on a null object reference
This happens if you try to read any key of any storage (other than the default shared_preferences), before you ever written anything into it.
The solution is to just check for null before attempting options.hasKey().
The error screenshot and a patch-package patch is available below.
Please include this fix in next releases.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
There is an issue when using this library on Android, where the method
private String sharedPreferences(ReadableMap options)
might receive anull
object foroptions
. Thus, callingoptions.hasKey()
on it will throw the following error:Attempt to invoke interface method 'boolean com.facebook.react.bridge.ReadableMap. hasKey(java.lang.String)' on a null object reference
This happens if you try to read any key of any storage (other than the default
shared_preferences
), before you ever written anything into it.The solution is to just check for null before attempting
options.hasKey()
.The error screenshot and a
patch-package
patch is available below. Please include this fix in next releases.react-native-sensitive-info/android/src/main/java/dev/mcodex/RNSensitiveInfoModule.java
react-native-sensitive-info+6.0.0-alpha.9.patch