Merge pull request #8546 from osmandapp/Fix_favorite_migrate_npe

Fix favorite migrate npe
This commit is contained in:
max-klaus 2020-02-24 15:42:33 +03:00 committed by GitHub
commit b548162ddd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -203,10 +203,18 @@ public class AppInitializer implements IProgress {
if (prevAppVersion < VERSION_3_5 || Version.getAppVersion(app).equals("3.5.3")
|| Version.getAppVersion(app).equals("3.5.4")) {
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();
addListener(new AppInitializeListener() {
@Override
public void onProgress(AppInitializer init, InitEvents event) {
if (event.equals(InitEvents.FAVORITES_INITIALIZED)) {
app.getSettings().migrateHomeWorkParkingToFavorites();
}
}
@Override
public void onFinish(AppInitializer init) {
}
});
startPrefs.edit().putInt(VERSION_INSTALLED_NUMBER, VERSION_3_5).commit();
}
if (prevAppVersion < VERSION_3_6) {