mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Merge "Fix: NPE when context.getFilesDir() returns null."
This commit is contained in:
commit
cfd3093362
@ -138,11 +138,13 @@ public class PersonalizationHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
dictionaryMap.clear();
|
dictionaryMap.clear();
|
||||||
if (!FileUtils.deleteFilteredFiles(
|
final File filesDir = context.getFilesDir();
|
||||||
context.getFilesDir(), new DictFilter(dictNamePrefix))) {
|
if (filesDir == null) {
|
||||||
|
Log.e(TAG, "context.getFilesDir() returned null.");
|
||||||
|
}
|
||||||
|
if (!FileUtils.deleteFilteredFiles(filesDir, new DictFilter(dictNamePrefix))) {
|
||||||
Log.e(TAG, "Cannot remove all existing dictionary files. filesDir: "
|
Log.e(TAG, "Cannot remove all existing dictionary files. filesDir: "
|
||||||
+ context.getFilesDir().getAbsolutePath() + ", dictNamePrefix: "
|
+ filesDir.getAbsolutePath() + ", dictNamePrefix: " + dictNamePrefix);
|
||||||
+ dictNamePrefix);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user