From 863a06f3af54c3caefc9ab09593672623c885853 Mon Sep 17 00:00:00 2001 From: Ammar Githam Date: Thu, 18 Mar 2021 21:57:49 +0900 Subject: [PATCH] Surrounding setSubtitle with try-catch to avoid crash. Handles 2nd part of https://github.com/austinhuang0131/barinsta/issues/816 --- .../awais/instagrabber/fragments/StoryViewerFragment.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/awais/instagrabber/fragments/StoryViewerFragment.java b/app/src/main/java/awais/instagrabber/fragments/StoryViewerFragment.java index f5818a4d..92e4ff66 100644 --- a/app/src/main/java/awais/instagrabber/fragments/StoryViewerFragment.java +++ b/app/src/main/java/awais/instagrabber/fragments/StoryViewerFragment.java @@ -885,7 +885,11 @@ public class StoryViewerFragment extends Fragment { final ActionBar actionBar = fragmentActivity.getSupportActionBar(); if (actionBar != null) { - actionBar.setSubtitle(Utils.datetimeParser.format(new Date(currentStory.getTimestamp() * 1000L))); + try { + actionBar.setSubtitle(Utils.datetimeParser.format(new Date(currentStory.getTimestamp() * 1000L))); + } catch (Exception e) { + Log.e(TAG, "refreshStory: ", e); + } } if (settingsHelper.getBoolean(MARK_AS_SEEN))