add check for added fragment

This commit is contained in:
Chumva 2018-05-24 18:16:40 +03:00
parent bad6f228a3
commit 76d9bc80b7

View file

@ -83,7 +83,7 @@ public class SavedArticlesTabFragment extends BaseOsmAndFragment implements Trav
@Override @Override
public void savedArticlesUpdated() { public void savedArticlesUpdated() {
if (adapter != null && getActivity() != null) { if (adapter != null && isAdded()) {
List<Object> newItems = getItems(); List<Object> newItems = getItems();
SavedArticlesDiffCallback diffCallback = new SavedArticlesDiffCallback(adapter.getItems(), newItems); SavedArticlesDiffCallback diffCallback = new SavedArticlesDiffCallback(adapter.getItems(), newItems);
DiffUtil.DiffResult diffRes = DiffUtil.calculateDiff(diffCallback); DiffUtil.DiffResult diffRes = DiffUtil.calculateDiff(diffCallback);