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