]> gitweb.fperrin.net Git - Dictionary.git/commitdiff
Make updating the dictionary list more robust.
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Sat, 12 Dec 2015 17:41:18 +0000 (18:41 +0100)
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>
Sat, 12 Dec 2015 17:41:18 +0000 (18:41 +0100)
It should be updated even if we fail to persist the config.

src/com/hughes/android/dictionary/DictionaryApplication.java

index 5470b812e06b67df10ca9ccb0c30555fd9bc68f5..b8022cebe827e08c9fe5ed7edc68dffbbe0724a2 100644 (file)
@@ -634,8 +634,13 @@ public class DictionaryApplication extends Application {
                     newDictionaryConfig.dictionaryFilesOrdered.addAll(toAddSorted);
                 }
 
-                PersistentObjectCache.getInstance()
-                        .write(C.DICTIONARY_CONFIGS, newDictionaryConfig);
+                try {
+                    PersistentObjectCache.getInstance()
+                                 .write(C.DICTIONARY_CONFIGS, newDictionaryConfig);
+                } catch (Exception e) {
+                    Log.e(LOG, "Failed persisting dictionary configs", e);
+                }
+
                 synchronized (this) {
                     dictionaryConfig = newDictionaryConfig;
                 }