diff --git a/OsmAnd/src/net/osmand/plus/GPXUtilities.java b/OsmAnd/src/net/osmand/plus/GPXUtilities.java index 8b5c35cb6c..6dd394c559 100644 --- a/OsmAnd/src/net/osmand/plus/GPXUtilities.java +++ b/OsmAnd/src/net/osmand/plus/GPXUtilities.java @@ -1402,10 +1402,10 @@ public class GPXUtilities { } catch (IOException e) { } return file; - } catch (FileNotFoundException e) { + } catch (IOException e) { GPXFile res = new GPXFile(); 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); return res; } finally { diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/WikivoyageLocalDataHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/WikivoyageLocalDataHelper.java index 5f0e191ff8..e3ed0b08fa 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/WikivoyageLocalDataHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/WikivoyageLocalDataHelper.java @@ -247,9 +247,11 @@ public class WikivoyageLocalDataHelper { if (oldVersion < 3) { 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"); - Object[] args = new Object[]{context.getWikivoyageDbHelper().getSelectedTravelBook().getName()}; - conn.execSQL("UPDATE " + HISTORY_TABLE_NAME + " SET " + HISTORY_COL_TRAVEL_BOOK + " = ?", args); - conn.execSQL("UPDATE " + BOOKMARKS_TABLE_NAME + " SET " + BOOKMARKS_COL_TRAVEL_BOOK + " = ?", args); + if(context.getWikivoyageDbHelper().getSelectedTravelBook() != null) { + Object[] args = new Object[]{context.getWikivoyageDbHelper().getSelectedTravelBook().getName()}; + conn.execSQL("UPDATE " + HISTORY_TABLE_NAME + " SET " + HISTORY_COL_TRAVEL_BOOK + " = ?", args); + conn.execSQL("UPDATE " + BOOKMARKS_TABLE_NAME + " SET " + BOOKMARKS_COL_TRAVEL_BOOK + " = ?", args); + } } }