diff --git a/client/src/main/java/net/i2p/android/router/service/State.java b/client/src/main/java/net/i2p/android/router/service/State.java index 148016e6ead15322190f0101aa479a6bde3718ba..383c8f095c75d59d34a22187163b02d48ccee39b 100644 --- a/client/src/main/java/net/i2p/android/router/service/State.java +++ b/client/src/main/java/net/i2p/android/router/service/State.java @@ -35,7 +35,13 @@ public enum State implements Parcelable { @Override public State createFromParcel(final Parcel source) { 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) { // Parcel is from a newer version of State with new states. return null;