I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit dc27a782 authored by str4d's avatar str4d
Browse files

Fixed NPE in client library with State unparceling

This only fixes the symptom, but the crash log on Google Play doesn't shed light
on what the problem is.
parent b633df73
No related branches found
No related tags found
No related merge requests found
...@@ -35,7 +35,13 @@ public enum State implements Parcelable { ...@@ -35,7 +35,13 @@ public enum State implements Parcelable {
@Override @Override
public State createFromParcel(final Parcel source) { public State createFromParcel(final Parcel source) {
try { try {
return State.valueOf(source.readString()); String stateVal = source.readString();
if (stateVal == null) {
// Somehow we got a null from the Parcel. Fail gracefully.
android.util.Log.e("I2P", "Received null from State Parcel.");
return null;
}
return State.valueOf(stateVal);
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
// Parcel is from a newer version of State with new states. // Parcel is from a newer version of State with new states.
return null; return null;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment