diff --git a/app/src/main/java/awais/instagrabber/dialogs/ProfilePicDialogFragment.java b/app/src/main/java/awais/instagrabber/dialogs/ProfilePicDialogFragment.java
index affe5cba..84a829cb 100644
--- a/app/src/main/java/awais/instagrabber/dialogs/ProfilePicDialogFragment.java
+++ b/app/src/main/java/awais/instagrabber/dialogs/ProfilePicDialogFragment.java
@@ -134,7 +134,14 @@ public class ProfilePicDialogFragment extends DialogFragment {
@Override
public void onSuccess(final User result) {
if (result != null) {
- setupPhoto(result.getHDProfilePicUrl());
+ final String url = result.getHDProfilePicUrl();
+ if (url == null) {
+ final Context context = getContext();
+ if (context == null) return;
+ Toast.makeText(context, R.string.no_profile_pic_found, Toast.LENGTH_LONG).show();
+ return;
+ }
+ setupPhoto(url);
}
}
diff --git a/app/src/main/java/awais/instagrabber/repositories/responses/User.java b/app/src/main/java/awais/instagrabber/repositories/responses/User.java
index 403ef285..b2f2a0b2 100644
--- a/app/src/main/java/awais/instagrabber/repositories/responses/User.java
+++ b/app/src/main/java/awais/instagrabber/repositories/responses/User.java
@@ -111,6 +111,9 @@ public class User implements Serializable {
}
public String getHDProfilePicUrl() {
+ if (hdProfilePicUrlInfo == null) {
+ return getProfilePicUrl();
+ }
return hdProfilePicUrlInfo.getUrl();
}
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 36fa5042..8c59762e 100755
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -504,4 +504,5 @@
Clear
No Map app found!
Click to view full count
+ No profile pic found!