From 8f4691a72ab409e6029a3b2e75a90c00423104a6 Mon Sep 17 00:00:00 2001 From: Ammar Githam Date: Thu, 29 Apr 2021 00:34:54 +0900 Subject: [PATCH] Handle possible exception on MainActivity destroy. Fixes part of austinhuang0131/barinsta#1099 --- .../java/awais/instagrabber/activities/MainActivity.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/awais/instagrabber/activities/MainActivity.java b/app/src/main/java/awais/instagrabber/activities/MainActivity.java index 80e1531c..09cd5967 100644 --- a/app/src/main/java/awais/instagrabber/activities/MainActivity.java +++ b/app/src/main/java/awais/instagrabber/activities/MainActivity.java @@ -326,7 +326,11 @@ public class MainActivity extends BaseLanguageActivity implements FragmentManage Log.e(TAG, "onDestroy: ", e); } unbindActivityCheckerService(); - RetrofitFactory.getInstance().destroy(); + try { + RetrofitFactory.getInstance().destroy(); + } catch (Exception e) { + Log.e(TAG, "onDestroy: ", e); + } } @Override