Browse Source

nullchecker fix for profileModel

renovate/org.robolectric-robolectric-4.x
junhuicoding 4 years ago
parent
commit
7f5b91e343
  1. 10
      app/src/main/java/awais/instagrabber/fragments/main/ProfileFragment.java

10
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); usernameTemp = usernameTemp.substring(1);
} }
if (TextUtils.isEmpty(usernameTemp)) { 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) { else if (isLoggedIn) {
userService.getUsernameInfo(usernameTemp, new ServiceCallback<User>() { userService.getUsernameInfo(usernameTemp, new ServiceCallback<User>() {

Loading…
Cancel
Save