diff --git a/app/src/main/java/net/i2p/android/router/service/RouterService.java b/app/src/main/java/net/i2p/android/router/service/RouterService.java index c9734786a0f3a67b091d64e4f4ecc92f333d3e51..edb09eb0d8ec1ca38691370f79b75c6c3f5afc30 100644 --- a/app/src/main/java/net/i2p/android/router/service/RouterService.java +++ b/app/src/main/java/net/i2p/android/router/service/RouterService.java @@ -766,7 +766,12 @@ public class RouterService extends Service { private int getSavedState() { SharedPreferences prefs = getSharedPreferences(SHARED_PREFS, 0); - return prefs.getInt(LAST_STATE, State.INIT); + try { + return prefs.getInt(LAST_STATE, State.INIT); + } catch (ClassCastException e) { + // Only a problem for first run after upgrade from old Enum state + return State.INIT; + } } private void setState(int s) {