This commit is contained in:
Victor Shcherb 2018-04-15 16:45:10 +02:00
parent e8ccd4eb45
commit 1c6f0b371d
2 changed files with 7 additions and 5 deletions

View file

@ -1402,10 +1402,10 @@ public class GPXUtilities {
} catch (IOException e) { } catch (IOException e) {
} }
return file; return file;
} catch (FileNotFoundException e) { } catch (IOException e) {
GPXFile res = new GPXFile(); GPXFile res = new GPXFile();
res.path = f.getAbsolutePath(); res.path = f.getAbsolutePath();
log.error("Error reading gpx", e); //$NON-NLS-1$ log.error("Error reading gpx " + res.path, e); //$NON-NLS-1$
res.warning = ctx.getString(R.string.error_reading_gpx); res.warning = ctx.getString(R.string.error_reading_gpx);
return res; return res;
} finally { } finally {

View file

@ -247,9 +247,11 @@ public class WikivoyageLocalDataHelper {
if (oldVersion < 3) { if (oldVersion < 3) {
conn.execSQL("ALTER TABLE " + HISTORY_TABLE_NAME + " ADD " + HISTORY_COL_TRAVEL_BOOK + " TEXT"); conn.execSQL("ALTER TABLE " + HISTORY_TABLE_NAME + " ADD " + HISTORY_COL_TRAVEL_BOOK + " TEXT");
conn.execSQL("ALTER TABLE " + BOOKMARKS_TABLE_NAME + " ADD " + BOOKMARKS_COL_TRAVEL_BOOK + " TEXT"); conn.execSQL("ALTER TABLE " + BOOKMARKS_TABLE_NAME + " ADD " + BOOKMARKS_COL_TRAVEL_BOOK + " TEXT");
Object[] args = new Object[]{context.getWikivoyageDbHelper().getSelectedTravelBook().getName()}; if(context.getWikivoyageDbHelper().getSelectedTravelBook() != null) {
conn.execSQL("UPDATE " + HISTORY_TABLE_NAME + " SET " + HISTORY_COL_TRAVEL_BOOK + " = ?", args); Object[] args = new Object[]{context.getWikivoyageDbHelper().getSelectedTravelBook().getName()};
conn.execSQL("UPDATE " + BOOKMARKS_TABLE_NAME + " SET " + BOOKMARKS_COL_TRAVEL_BOOK + " = ?", args); conn.execSQL("UPDATE " + HISTORY_TABLE_NAME + " SET " + HISTORY_COL_TRAVEL_BOOK + " = ?", args);
conn.execSQL("UPDATE " + BOOKMARKS_TABLE_NAME + " SET " + BOOKMARKS_COL_TRAVEL_BOOK + " = ?", args);
}
} }
} }