Avoid crashes

This commit is contained in:
stom79 2019-01-22 16:19:33 +01:00
parent dd0c80118f
commit c4c6f7995f
1 changed files with 7 additions and 3 deletions

View File

@ -1017,9 +1017,13 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
status.setFetchMore(false);
holder.fetch_more.setEnabled(false);
holder.fetch_more.setVisibility(View.GONE);
DisplayStatusFragment homeFragment = ((BaseMainActivity) context).getHomeFragment();
if (homeFragment != null)
homeFragment.fetchMore(status.getId());
if( context instanceof BaseMainActivity) {
DisplayStatusFragment homeFragment = ((BaseMainActivity) context).getHomeFragment();
if (homeFragment != null)
homeFragment.fetchMore(status.getId());
}else{
Toasty.error(context, context.getString(R.string.toast_error), Toast.LENGTH_LONG).show();
}
}
});
} else {