Fix NPE in TravelLocalDataHelper
This commit is contained in:
parent
faa88a3347
commit
1ec9acd00f
1 changed files with 4 additions and 3 deletions
|
@ -22,7 +22,7 @@ public class TravelLocalDataHelper {
|
|||
private WikivoyageLocalDataDbHelper dbHelper;
|
||||
|
||||
private TLongObjectHashMap<WikivoyageSearchHistoryItem> historyMap;
|
||||
private List<TravelArticle> savedArticles;
|
||||
private List<TravelArticle> savedArticles = new ArrayList<>();
|
||||
|
||||
private Listener listener;
|
||||
|
||||
|
@ -36,7 +36,8 @@ public class TravelLocalDataHelper {
|
|||
|
||||
void refreshCachedData() {
|
||||
historyMap = dbHelper.getAllHistoryMap();
|
||||
savedArticles = dbHelper.readSavedArticles();
|
||||
savedArticles.clear();
|
||||
savedArticles.addAll(dbHelper.readSavedArticles());
|
||||
}
|
||||
|
||||
public List<WikivoyageSearchHistoryItem> getAllHistory() {
|
||||
|
@ -114,7 +115,7 @@ public class TravelLocalDataHelper {
|
|||
savedArticles.add(article);
|
||||
dbHelper.addSavedArticle(article);
|
||||
notifySavedUpdated();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void removeArticleFromSaved(@NonNull TravelArticle article) {
|
||||
|
|
Loading…
Reference in a new issue