From 01ae2bed089456666b4f1a322cfb12124c5768af Mon Sep 17 00:00:00 2001 From: Alex Sytnyk Date: Thu, 3 May 2018 11:37:59 +0300 Subject: [PATCH] Fix possible NPE --- .../plus/wikivoyage/explore/SavedArticlesTabFragment.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/SavedArticlesTabFragment.java b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/SavedArticlesTabFragment.java index a7418e035a..21c5f02146 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/SavedArticlesTabFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/SavedArticlesTabFragment.java @@ -3,6 +3,7 @@ package net.osmand.plus.wikivoyage.explore; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; +import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentManager; import android.support.v7.util.DiffUtil; import android.support.v7.widget.LinearLayoutManager; @@ -45,8 +46,9 @@ public class SavedArticlesTabFragment extends BaseOsmAndFragment implements Trav adapter.setListener(new SavedArticlesRvAdapter.Listener() { @Override public void openArticle(TravelArticle article) { - FragmentManager fm = getActivity().getSupportFragmentManager(); - if (fm != null) { + FragmentActivity activity = getActivity(); + if (activity != null) { + FragmentManager fm = activity.getSupportFragmentManager(); WikivoyageArticleDialogFragment.showInstance(app, fm, article.getCityId(), article.getLang()); } }