Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cfd30933 authored by Keisuke Kuroyanagi's avatar Keisuke Kuroyanagi Committed by Android (Google) Code Review
Browse files

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

parents 812d7d93 a545e8dd
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -138,11 +138,13 @@ public class PersonalizationHelper {
                }
            }
            dictionaryMap.clear();
            if (!FileUtils.deleteFilteredFiles(
                    context.getFilesDir(), new DictFilter(dictNamePrefix))) {
            final File filesDir = context.getFilesDir();
            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: "
                        + context.getFilesDir().getAbsolutePath() + ", dictNamePrefix: "
                        + dictNamePrefix);
                        + filesDir.getAbsolutePath() + ", dictNamePrefix: " + dictNamePrefix);
            }
        }
    }