Fix possible NPE, remove unnecessary track visibility set
This commit is contained in:
parent
3a5e8c6230
commit
c3ee44ffac
2 changed files with 12 additions and 10 deletions
|
@ -257,10 +257,11 @@ public class WikivoyageArticleDialogFragment extends WikiArticleBaseDialogFragme
|
|||
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();
|
||||
|
|
|
@ -107,10 +107,11 @@ public class ArticleTravelCard extends BaseTravelCard {
|
|||
app.getTravelHelper().createGpxFile(article);
|
||||
GPXFile gpxFile = article.getGpxFile();
|
||||
if (saved) {
|
||||
if (gpxFile != null) {
|
||||
app.getSelectedGpxHelper().selectGpxFile(gpxFile, false, true);
|
||||
}
|
||||
helper.removeArticleFromSaved(article);
|
||||
} else {
|
||||
app.getSelectedGpxHelper().selectGpxFile(gpxFile, true, true);
|
||||
helper.addArticleToSaved(article);
|
||||
}
|
||||
updateSaveButton(holder);
|
||||
|
|
Loading…
Reference in a new issue