From 3e06cb20790ba53d213944352f9c55227cb24f1d Mon Sep 17 00:00:00 2001 From: Ammar Githam Date: Sun, 25 Apr 2021 16:18:58 +0900 Subject: [PATCH] Null check. Fixes austinhuang0131/barinsta#1125 --- .../awais/instagrabber/fragments/PostViewV2Fragment.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/awais/instagrabber/fragments/PostViewV2Fragment.java b/app/src/main/java/awais/instagrabber/fragments/PostViewV2Fragment.java index 7a53ec2d..dc37c372 100644 --- a/app/src/main/java/awais/instagrabber/fragments/PostViewV2Fragment.java +++ b/app/src/main/java/awais/instagrabber/fragments/PostViewV2Fragment.java @@ -1002,7 +1002,11 @@ public class PostViewV2Fragment extends SharedElementTransitionDialogFragment im addSharedElement(sharedMainPostElement, binding.postImage); } final Media media = viewModel.getMedia(); - final ImageRequest requestBuilder = ImageRequestBuilder.newBuilderWithSource(Uri.parse(ResponseBodyUtils.getImageUrl(media))) + final String imageUrl = ResponseBodyUtils.getImageUrl(media); + if (TextUtils.isEmpty(imageUrl)) { + return; + } + final ImageRequest requestBuilder = ImageRequestBuilder.newBuilderWithSource(Uri.parse(imageUrl)) .setLocalThumbnailPreviewsEnabled(true) .build(); final DraweeController controller = Fresco