Fix npe
This commit is contained in:
parent
e8ccd4eb45
commit
1c6f0b371d
2 changed files with 7 additions and 5 deletions
|
@ -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 {
|
||||||
|
|
|
@ -247,11 +247,13 @@ 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");
|
||||||
|
if(context.getWikivoyageDbHelper().getSelectedTravelBook() != null) {
|
||||||
Object[] args = new Object[]{context.getWikivoyageDbHelper().getSelectedTravelBook().getName()};
|
Object[] args = new Object[]{context.getWikivoyageDbHelper().getSelectedTravelBook().getName()};
|
||||||
conn.execSQL("UPDATE " + HISTORY_TABLE_NAME + " SET " + HISTORY_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);
|
conn.execSQL("UPDATE " + BOOKMARKS_TABLE_NAME + " SET " + BOOKMARKS_COL_TRAVEL_BOOK + " = ?", args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
TLongObjectHashMap<WikivoyageSearchHistoryItem> getAllHistoryMap() {
|
TLongObjectHashMap<WikivoyageSearchHistoryItem> getAllHistoryMap() {
|
||||||
|
|
Loading…
Reference in a new issue