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);
|
getMyApplication().getTravelHelper().createGpxFile(article);
|
||||||
GPXFile gpxFile = article.getGpxFile();
|
GPXFile gpxFile = article.getGpxFile();
|
||||||
if (saved) {
|
if (saved) {
|
||||||
|
if (gpxFile != null) {
|
||||||
getMyApplication().getSelectedGpxHelper().selectGpxFile(gpxFile, false, true);
|
getMyApplication().getSelectedGpxHelper().selectGpxFile(gpxFile, false, true);
|
||||||
|
}
|
||||||
helper.removeArticleFromSaved(article);
|
helper.removeArticleFromSaved(article);
|
||||||
} else {
|
} else {
|
||||||
getMyApplication().getSelectedGpxHelper().selectGpxFile(gpxFile, true, true);
|
|
||||||
helper.addArticleToSaved(article);
|
helper.addArticleToSaved(article);
|
||||||
}
|
}
|
||||||
updateSaveButton();
|
updateSaveButton();
|
||||||
|
|
|
@ -107,10 +107,11 @@ public class ArticleTravelCard extends BaseTravelCard {
|
||||||
app.getTravelHelper().createGpxFile(article);
|
app.getTravelHelper().createGpxFile(article);
|
||||||
GPXFile gpxFile = article.getGpxFile();
|
GPXFile gpxFile = article.getGpxFile();
|
||||||
if (saved) {
|
if (saved) {
|
||||||
|
if (gpxFile != null) {
|
||||||
app.getSelectedGpxHelper().selectGpxFile(gpxFile, false, true);
|
app.getSelectedGpxHelper().selectGpxFile(gpxFile, false, true);
|
||||||
|
}
|
||||||
helper.removeArticleFromSaved(article);
|
helper.removeArticleFromSaved(article);
|
||||||
} else {
|
} else {
|
||||||
app.getSelectedGpxHelper().selectGpxFile(gpxFile, true, true);
|
|
||||||
helper.addArticleToSaved(article);
|
helper.addArticleToSaved(article);
|
||||||
}
|
}
|
||||||
updateSaveButton(holder);
|
updateSaveButton(holder);
|
||||||
|
|
Loading…
Reference in a new issue