Fix favorite migrate npe

This commit is contained in:
Dima-1 2020-02-23 10:47:45 +02:00
parent 92b9293e16
commit 70d52b4dcc
2 changed files with 8 additions and 4 deletions

View file

@ -205,10 +205,6 @@ public class AppInitializer implements IProgress {
app.getSettings().migratePreferences();
startPrefs.edit().putInt(VERSION_INSTALLED_NUMBER, VERSION_3_5).commit();
}
if (prevAppVersion < VERSION_3_5 || Version.getAppVersion(app).equals("3.5.3")) {
app.getSettings().migrateHomeWorkParkingToFavorites();
startPrefs.edit().putInt(VERSION_INSTALLED_NUMBER, VERSION_3_5).commit();
}
if (prevAppVersion < VERSION_3_6) {
app.getSettings().migratePreferences();
startPrefs.edit().putInt(VERSION_INSTALLED_NUMBER, VERSION_3_6).commit();
@ -221,6 +217,13 @@ public class AppInitializer implements IProgress {
initSettings = true;
}
void migrateHomeWorkFromSettings() {
if (prevAppVersion < VERSION_3_5 || Version.getAppVersion(app).equals("3.5.3")) {
app.getSettings().migrateHomeWorkParkingToFavorites();
startPrefs.edit().putInt(VERSION_INSTALLED_NUMBER, VERSION_3_5).commit();
}
}
public int getNumberOfStarts() {
if(startPrefs == null) {
return 0;

View file

@ -190,6 +190,7 @@ public class OsmandApplication extends MultiDexApplication {
checkPreferredLocale();
appInitializer.onCreateApplication();
appInitializer.migrateHomeWorkFromSettings();
// if(!osmandSettings.FOLLOW_THE_ROUTE.get()) {
// targetPointsHelper.clearPointToNavigate(false);
// }