diff --git a/java/src/com/android/inputmethod/latin/DebugSettings.java b/java/src/com/android/inputmethod/latin/DebugSettings.java index d1792a369..9be87848f 100644 --- a/java/src/com/android/inputmethod/latin/DebugSettings.java +++ b/java/src/com/android/inputmethod/latin/DebugSettings.java @@ -107,6 +107,9 @@ public final class DebugSettings extends PreferenceFragment String version = ""; try { final Context context = getActivity(); + if (context == null) { + return; + } final String packageName = context.getPackageName(); PackageInfo info = context.getPackageManager().getPackageInfo(packageName, 0); version = "Version " + info.versionName;