fix crash on missing user profile data

This commit is contained in:
dosiecki 2017-06-30 13:29:32 -07:00
parent 995256fb31
commit 1bf62d4b91
2 changed files with 8 additions and 1 deletions

View file

@ -103,11 +103,18 @@ public abstract class ProfileActivityDetailsFragment extends Fragment implements
if (id == null) {
id = user.id;
}
if (id == null) {
return null;
}
return loadActivityDetails(id, pageNumber);
}
@Override
protected void onPostExecute(ActivityDetails[] result) {
if (result == null) {
com.newsblur.util.Log.w(getClass().getName(), "couldn't load page from API");
return;
}
if (pageNumber == 1 && result.length == 0) {
View emptyView = activityList.getEmptyView();
TextView textView = (TextView) emptyView.findViewById(R.id.empty_view_text);

View file

@ -24,7 +24,7 @@ public class ProfileInteractionsFragment extends ProfileActivityDetailsFragment
if (interactionsResponse != null) {
return interactionsResponse.interactions;
} else {
return new ActivityDetails[0];
return null;
}
}
}