add check for added fragment

This commit is contained in:
Chumva 2018-05-24 18:16:40 +03:00 committed by Alex Sytnyk
parent 0e05982316
commit 19e37545ec

View file

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