Skip to content
This repository has been archived by the owner on Mar 1, 2022. It is now read-only.

SecurePreferences.getInt throw java.lang.ClassCastException:null #62

Open
pzl237 opened this issue Apr 26, 2017 · 1 comment
Open

SecurePreferences.getInt throw java.lang.ClassCastException:null #62

pzl237 opened this issue Apr 26, 2017 · 1 comment
Milestone

Comments

@pzl237
Copy link

pzl237 commented Apr 26, 2017

My app uses the version 0.1.4.
Recently, I met a problem: call SecurePreferences. getInt() method, throw "Java. Lang. ClassCastException: null". I find in source code, and find the decrypt (final String ciphertext) method may return null, so the Integer. ParseInt (null) method would throw this exception. I think SecurePreferences. getInt (String key, int defaultValue) method should take the initiative to throw an exception, life for SecurePreferences. getInt (String key, int defaultValue) method throws a NumberFormatException, so that the caller can try catch this a NumberFormatException exception.

@scottyab scottyab modified the milestone: v0.2 May 10, 2017
@alkaaf
Copy link

alkaaf commented Mar 26, 2018

i got this error too, it is very rare tho. idk what happened but seems it failed to decipher the encrypted string causing Integer.parseInt fail to parse.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants