mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Fix force close when attempting to fetch a user with a null user.id value
This commit is contained in:
parent
e0a69563f1
commit
c82f7a906a
1 changed files with 7 additions and 4 deletions
|
@ -89,12 +89,15 @@ public class Profile extends SherlockFragmentActivity {
|
|||
user = profileResponse.user;
|
||||
activities = profileResponse.activities;
|
||||
} else {
|
||||
// TODO if profileResponse null then null user.id will cause force close ?
|
||||
apiManager.updateUserProfile();
|
||||
user = PrefsUtils.getUserDetails(Profile.this);
|
||||
profileResponse = apiManager.getUser(user.id);
|
||||
if (profileResponse != null) {
|
||||
activities = profileResponse.activities;
|
||||
// check user.id has been set. If previous attempts to update the user details
|
||||
// have failed then user.id == null would cause a force close
|
||||
if (user.id != null) {
|
||||
profileResponse = apiManager.getUser(user.id);
|
||||
if (profileResponse != null) {
|
||||
activities = profileResponse.activities;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
|
Loading…
Add table
Reference in a new issue