From 79ff803cb0d30a162d05cdd06347d084f98b1284 Mon Sep 17 00:00:00 2001 From: Keisuke Kuroyanagi Date: Mon, 28 Jul 2014 19:25:07 +0900 Subject: [PATCH] Fix NPE when context.getFilesDir() returns null. Bug: 16416948 Change-Id: I0fac5ab26d6efbadbd688d033a79f6705e0161a5 --- .../inputmethod/latin/personalization/PersonalizationHelper.java | 1 + 1 file changed, 1 insertion(+) diff --git a/java/src/com/android/inputmethod/latin/personalization/PersonalizationHelper.java b/java/src/com/android/inputmethod/latin/personalization/PersonalizationHelper.java index aac40940b..331f85e0e 100644 --- a/java/src/com/android/inputmethod/latin/personalization/PersonalizationHelper.java +++ b/java/src/com/android/inputmethod/latin/personalization/PersonalizationHelper.java @@ -138,6 +138,7 @@ public class PersonalizationHelper { final File filesDir = context.getFilesDir(); if (filesDir == null) { Log.e(TAG, "context.getFilesDir() returned null."); + return; } if (!FileUtils.deleteFilteredFiles(filesDir, new DictFilter(dictNamePrefix))) { Log.e(TAG, "Cannot remove all existing dictionary files. filesDir: "