Fix: NPE when context.getFilesDir() returns null.
Bug: 14517587 Change-Id: Ib99bea14eab3a25ddb5042527b757133734a6ba6
This commit is contained in:
parent
d94567d963
commit
a545e8dd23
1 changed files with 6 additions and 4 deletions
|
@ -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…
Reference in a new issue