Skip to content
Snippets Groups Projects
Commit a545e8dd authored by Keisuke Kuroyanagi's avatar Keisuke Kuroyanagi
Browse files

Fix: NPE when context.getFilesDir() returns null.

Bug: 14517587
Change-Id: Ib99bea14eab3a25ddb5042527b757133734a6ba6
parent d94567d9
No related branches found
No related tags found
No related merge requests found
...@@ -138,11 +138,13 @@ public class PersonalizationHelper { ...@@ -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);
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment