fixed a NullPointerException when loading a dictionary from an update notification
This commit is contained in:
parent
2339aec1b6
commit
78b78923cf
1 changed files with 6 additions and 6 deletions
|
|
@ -108,7 +108,7 @@ public class DictionaryLoader {
|
||||||
|
|
||||||
|
|
||||||
public static void load(Context context, Language language) {
|
public static void load(Context context, Language language) {
|
||||||
self.load(context, new ArrayList<>() {{ add(language); }});
|
getInstance(context).load(context, new ArrayList<>() {{ add(language); }});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -125,7 +125,7 @@ public class DictionaryLoader {
|
||||||
|
|
||||||
DataStore.getLastLanguageUpdateTime(
|
DataStore.getLastLanguageUpdateTime(
|
||||||
(hash) -> {
|
(hash) -> {
|
||||||
self.lastAutoLoadAttemptTime.put(language.getId(), System.currentTimeMillis());
|
getInstance(context).lastAutoLoadAttemptTime.put(language.getId(), System.currentTimeMillis());
|
||||||
|
|
||||||
// no words at all, load without confirmation
|
// no words at all, load without confirmation
|
||||||
if (hash.isEmpty()) {
|
if (hash.isEmpty()) {
|
||||||
|
|
@ -206,12 +206,12 @@ public class DictionaryLoader {
|
||||||
} catch (DictionaryImportAbortedException e) {
|
} catch (DictionaryImportAbortedException e) {
|
||||||
sqlite.failTransaction();
|
sqlite.failTransaction();
|
||||||
stop();
|
stop();
|
||||||
self.lastAutoLoadAttemptTime.put(language.getId(), null);
|
lastAutoLoadAttemptTime.put(language.getId(), null);
|
||||||
Logger.i(LOG_TAG, e.getMessage() + ". File '" + language.getDictionaryFile() + "' not imported.");
|
Logger.i(LOG_TAG, e.getMessage() + ". File '" + language.getDictionaryFile() + "' not imported.");
|
||||||
} catch (DictionaryImportException e) {
|
} catch (DictionaryImportException e) {
|
||||||
stop();
|
stop();
|
||||||
sqlite.failTransaction();
|
sqlite.failTransaction();
|
||||||
self.lastAutoLoadAttemptTime.put(language.getId(), null);
|
lastAutoLoadAttemptTime.put(language.getId(), null);
|
||||||
sendImportError(DictionaryImportException.class.getSimpleName(), language.getId(), e.line);
|
sendImportError(DictionaryImportException.class.getSimpleName(), language.getId(), e.line);
|
||||||
|
|
||||||
Logger.e(
|
Logger.e(
|
||||||
|
|
@ -226,9 +226,9 @@ public class DictionaryLoader {
|
||||||
sendError(e.getClass().getSimpleName(), language.getId());
|
sendError(e.getClass().getSimpleName(), language.getId());
|
||||||
|
|
||||||
if (e instanceof UnknownHostException) {
|
if (e instanceof UnknownHostException) {
|
||||||
self.lastAutoLoadAttemptTime.put(language.getId(), System.currentTimeMillis());
|
lastAutoLoadAttemptTime.put(language.getId(), System.currentTimeMillis());
|
||||||
} else {
|
} else {
|
||||||
self.lastAutoLoadAttemptTime.put(language.getId(), null);
|
lastAutoLoadAttemptTime.put(language.getId(), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger.e(
|
Logger.e(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue