Fix a crash
This commit is contained in:
parent
cab9687b48
commit
f95a18c647
|
@ -48,10 +48,12 @@ public class ManageCachedStatusAsyncTask extends AsyncTask<Void, Void, Void> {
|
||||||
@Override
|
@Override
|
||||||
protected Void doInBackground(Void... params) {
|
protected Void doInBackground(Void... params) {
|
||||||
APIResponse apiResponse = new API(contextReference.get()).getStatusbyIdAndCache(statusId);
|
APIResponse apiResponse = new API(contextReference.get()).getStatusbyIdAndCache(statusId);
|
||||||
|
if( apiResponse.getStatuses().size() > 0){
|
||||||
refreshedStatus = apiResponse.getStatuses().get(0);
|
refreshedStatus = apiResponse.getStatuses().get(0);
|
||||||
if( refreshedStatus != null){
|
if( refreshedStatus != null){
|
||||||
refreshedStatus.setcached(true);
|
refreshedStatus.setcached(true);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3207,6 +3207,8 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
}
|
}
|
||||||
|
|
||||||
public void notifyStatusWithActionChanged(Status status){
|
public void notifyStatusWithActionChanged(Status status){
|
||||||
|
if( status == null)
|
||||||
|
return;
|
||||||
for (int i = 0; i < statusListAdapter.getItemCount(); i++) {
|
for (int i = 0; i < statusListAdapter.getItemCount(); i++) {
|
||||||
//noinspection ConstantConditions
|
//noinspection ConstantConditions
|
||||||
if (statusListAdapter.getItemAt(i) != null && statusListAdapter.getItemAt(i).getId().equals(status.getId())) {
|
if (statusListAdapter.getItemAt(i) != null && statusListAdapter.getItemAt(i).getId().equals(status.getId())) {
|
||||||
|
|
Loading…
Reference in New Issue