From a0983249bb09b05ec10d3b8aa3b8e34fea8a31eb Mon Sep 17 00:00:00 2001 From: Austin Huang Date: Sat, 24 Jul 2021 10:28:46 -0400 Subject: [PATCH] close #1737 --- .../awais/instagrabber/fragments/PostViewV2Fragment.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/awais/instagrabber/fragments/PostViewV2Fragment.java b/app/src/main/java/awais/instagrabber/fragments/PostViewV2Fragment.java index cd9199db..cb492dca 100644 --- a/app/src/main/java/awais/instagrabber/fragments/PostViewV2Fragment.java +++ b/app/src/main/java/awais/instagrabber/fragments/PostViewV2Fragment.java @@ -268,10 +268,13 @@ public class PostViewV2Fragment extends Fragment implements EditTextDialogFragme @Override public void onSaveInstanceState(@NonNull final Bundle outState) { super.onSaveInstanceState(outState); - final Media media = viewModel.getMedia(); - if (media.getType() == MediaItemType.MEDIA_TYPE_SLIDER) { - outState.putInt(ARG_SLIDER_POSITION, sliderPosition); + try { + final Media media = viewModel.getMedia(); + if (media.getType() == MediaItemType.MEDIA_TYPE_SLIDER) { + outState.putInt(ARG_SLIDER_POSITION, sliderPosition); + } } + catch (Exception _) {} } @Override