From 7f5b91e343f01e1266133d3cf87bcc27b1512796 Mon Sep 17 00:00:00 2001 From: junhuicoding Date: Thu, 1 Apr 2021 00:24:15 +0800 Subject: [PATCH] nullchecker fix for profileModel --- .../instagrabber/fragments/main/ProfileFragment.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/awais/instagrabber/fragments/main/ProfileFragment.java b/app/src/main/java/awais/instagrabber/fragments/main/ProfileFragment.java index 4b3bfcfd..2f040392 100644 --- a/app/src/main/java/awais/instagrabber/fragments/main/ProfileFragment.java +++ b/app/src/main/java/awais/instagrabber/fragments/main/ProfileFragment.java @@ -604,10 +604,12 @@ public class ProfileFragment extends Fragment implements SwipeRefreshLayout.OnRe usernameTemp = usernameTemp.substring(1); } if (TextUtils.isEmpty(usernameTemp)) { - profileModel = appStateViewModel.getCurrentUser(); - username = profileModel.getUsername(); - setUsernameDelayed(); - setProfileDetails(); + profileModel = appStateViewModel.getCurrentUser(); + if (profileModel != null) { + username = profileModel.getUsername(); + setUsernameDelayed(); + setProfileDetails(); + } } else if (isLoggedIn) { userService.getUsernameInfo(usernameTemp, new ServiceCallback() {