Fix TravelDbHelper#initTravelBooks

This commit is contained in:
Alex Sytnyk 2018-04-16 13:55:53 +03:00
parent 38f9235721
commit 85b9c1e629

View file

@ -95,7 +95,7 @@ public class TravelDbHelper {
File[] possibleFiles = application.getAppPath(IndexConstants.WIKIVOYAGE_INDEX_DIR).listFiles();
String travelBook = application.getSettings().SELECTED_TRAVEL_BOOK.get();
existingTravelBooks.clear();
if (possibleFiles != null) {
if (possibleFiles != null && possibleFiles.length > 0) {
for (File f : possibleFiles) {
if (f.getName().endsWith(IndexConstants.BINARY_WIKIVOYAGE_MAP_INDEX_EXT)) {
existingTravelBooks.add(f);
@ -106,6 +106,8 @@ public class TravelDbHelper {
}
}
}
} else {
selectedTravelBook = null;
}
localDataHelper.refreshCachedData();
}