From e8b4fd264476c59dbfc997ce645f077e64d8f0c8 Mon Sep 17 00:00:00 2001 From: satok Date: Thu, 10 Jan 2013 19:57:33 +0900 Subject: [PATCH] fix possible NPE in DebugSettings Change-Id: I44ec5bd3b2a00087603316f14d732164dbcf399f --- java/src/com/android/inputmethod/latin/DebugSettings.java | 3 +++ 1 file changed, 3 insertions(+) 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;