aboutsummaryrefslogtreecommitdiff
path: root/WordPress/src/main/java/org/wordpress
diff options
context:
space:
mode:
authorMaxime Biais <maxime.biais@gmail.com>2015-03-02 17:38:11 +0100
committerMaxime Biais <maxime.biais@gmail.com>2015-03-02 17:38:11 +0100
commit38cec009e05d6fbf94cbba0e5c75f5f7336345b4 (patch)
tree4f4ca474a30d4b82d7ecf85749354c60d59d9f63 /WordPress/src/main/java/org/wordpress
parent1804e9c61be58200f5a83e8d5d16597516bc6c1a (diff)
downloadgradle-perf-android-medium-38cec009e05d6fbf94cbba0e5c75f5f7336345b4.tar.gz
fix #2372 by catching IllegalStateException
Diffstat (limited to 'WordPress/src/main/java/org/wordpress')
-rw-r--r--WordPress/src/main/java/org/wordpress/android/ui/WPDrawerActivity.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/WordPress/src/main/java/org/wordpress/android/ui/WPDrawerActivity.java b/WordPress/src/main/java/org/wordpress/android/ui/WPDrawerActivity.java
index c9dcc88a2..37409569f 100644
--- a/WordPress/src/main/java/org/wordpress/android/ui/WPDrawerActivity.java
+++ b/WordPress/src/main/java/org/wordpress/android/ui/WPDrawerActivity.java
@@ -57,6 +57,7 @@ import org.wordpress.android.util.WPActivityUtils;
import org.xmlrpc.android.ApiHelper;
import org.xmlrpc.android.ApiHelper.ErrorType;
+import java.util.IllegalFormatCodePointException;
import java.util.List;
import java.util.Map;
@@ -291,7 +292,13 @@ public abstract class WPDrawerActivity extends ActionBarActivity {
FragmentManager fm = getFragmentManager();
if (fm.getBackStackEntryCount() > 0) {
- fm.popBackStack();
+ try {
+ fm.popBackStack();
+ } catch (IllegalStateException e) {
+ // onClick event can be fired after the onSaveInstanceState call,
+ // and make the app crash. Catching this exception avoid the crash. If this existed,
+ // we would use popBackStackAllowingStateLoss.
+ }
} else if (isStaticMenuDrawer()) {
finish();
} else {