Ensure values are reset between dictionary list entries
app/src/main/java/eu/lepiller/nani/dictionary/DictionaryFactory.java
| 99 | 99 | String currentLanguage = ""; | |
| 100 | 100 | String lang = ""; | |
| 101 | 101 | ||
| 102 | - | Dictionary d; | |
| 102 | + | Dictionary d = null; | |
| 103 | 103 | while((line = br.readLine()) != null) { | |
| 104 | 104 | if(line.isEmpty()) { | |
| 105 | 105 | // create dictionary | |
… | |||
| 129 | 129 | chooseLanguage(synopsis), | |
| 130 | 130 | chooseLanguage(description), | |
| 131 | 131 | cacheDir, url, size, entries, sha256, lang); | |
| 132 | - | } else { | |
| 133 | - | continue; | |
| 134 | 132 | } | |
| 135 | 133 | ||
| 136 | - | if(d.isDownloaded()) { | |
| 137 | - | dictionaries.add(0, d); | |
| 138 | - | } else { | |
| 139 | - | dictionaries.add(d); | |
| 134 | + | if(d != null) { | |
| 135 | + | if (d.isDownloaded()) { | |
| 136 | + | dictionaries.add(0, d); | |
| 137 | + | } else { | |
| 138 | + | dictionaries.add(d); | |
| 139 | + | } | |
| 140 | 140 | } | |
| 141 | + | ||
| 142 | + | synopsis = new HashMap<>(); | |
| 143 | + | description = new HashMap<>(); | |
| 144 | + | sha256 = ""; | |
| 145 | + | size = 0; | |
| 146 | + | type = ""; | |
| 147 | + | entries = 0; | |
| 148 | + | url = ""; | |
| 149 | + | name = ""; | |
| 150 | + | currentLanguage = ""; | |
| 151 | + | lang = ""; | |
| 152 | + | d = null; | |
| 141 | 153 | } | |
| 142 | 154 | ||
| 143 | 155 | if(line.startsWith("[")) { | |