refactor(follower): move null check in called method
This commit is contained in:
parent
e4f4ca5392
commit
4da6016e06
|
@ -74,6 +74,8 @@ public abstract class BaseAccountListFragment extends RecyclerFragment<BaseAccou
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDataLoaded(List<AccountItem> d, boolean more){
|
protected void onDataLoaded(List<AccountItem> d, boolean more){
|
||||||
|
if (getActivity() == null)
|
||||||
|
return;
|
||||||
if(refreshing){
|
if(refreshing){
|
||||||
relationships.clear();
|
relationships.clear();
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,6 @@ public abstract class PaginatedAccountListFragment extends BaseAccountListFragme
|
||||||
nextMaxID=result.nextPageUri.getQueryParameter("max_id");
|
nextMaxID=result.nextPageUri.getQueryParameter("max_id");
|
||||||
else
|
else
|
||||||
nextMaxID=null;
|
nextMaxID=null;
|
||||||
if (getActivity() == null) return;
|
|
||||||
onDataLoaded(result.stream().map(AccountItem::new).collect(Collectors.toList()), nextMaxID!=null);
|
onDataLoaded(result.stream().map(AccountItem::new).collect(Collectors.toList()), nextMaxID!=null);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -69,7 +68,6 @@ public abstract class PaginatedAccountListFragment extends BaseAccountListFragme
|
||||||
remoteAccount.acct += "@" + Uri.parse(remoteAccount.url).getHost();
|
remoteAccount.acct += "@" + Uri.parse(remoteAccount.url).getHost();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (getActivity() == null) return;
|
|
||||||
onDataLoaded(result.stream().map(AccountItem::new).collect(Collectors.toList()), false);
|
onDataLoaded(result.stream().map(AccountItem::new).collect(Collectors.toList()), false);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue