diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java b/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java index 0205feaaf6..ba4f5b6f85 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java @@ -254,17 +254,18 @@ public class WikivoyageArticleDialogFragment extends WikiArticleBaseDialogFragme saveBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - getMyApplication().getTravelHelper().createGpxFile(article); - GPXFile gpxFile = article.getGpxFile(); - if (saved) { + getMyApplication().getTravelHelper().createGpxFile(article); + GPXFile gpxFile = article.getGpxFile(); + if (saved) { + if (gpxFile != null) { getMyApplication().getSelectedGpxHelper().selectGpxFile(gpxFile, false, true); - helper.removeArticleFromSaved(article); - } else { - getMyApplication().getSelectedGpxHelper().selectGpxFile(gpxFile, true, true); - helper.addArticleToSaved(article); } - updateSaveButton(); + helper.removeArticleFromSaved(article); + } else { + helper.addArticleToSaved(article); } + updateSaveButton(); + } }); } } diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/ArticleTravelCard.java b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/ArticleTravelCard.java index ef59c079a3..0a81e48c6d 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/ArticleTravelCard.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/ArticleTravelCard.java @@ -107,10 +107,11 @@ public class ArticleTravelCard extends BaseTravelCard { app.getTravelHelper().createGpxFile(article); GPXFile gpxFile = article.getGpxFile(); if (saved) { - app.getSelectedGpxHelper().selectGpxFile(gpxFile, false, true); + if (gpxFile != null) { + app.getSelectedGpxHelper().selectGpxFile(gpxFile, false, true); + } helper.removeArticleFromSaved(article); } else { - app.getSelectedGpxHelper().selectGpxFile(gpxFile, true, true); helper.addArticleToSaved(article); } updateSaveButton(holder);