fix possible NPE in DebugSettings
Change-Id: I44ec5bd3b2a00087603316f14d732164dbcf399fmain
parent
6512cd289d
commit
e8b4fd2644
|
@ -107,6 +107,9 @@ public final class DebugSettings extends PreferenceFragment
|
||||||
String version = "";
|
String version = "";
|
||||||
try {
|
try {
|
||||||
final Context context = getActivity();
|
final Context context = getActivity();
|
||||||
|
if (context == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
final String packageName = context.getPackageName();
|
final String packageName = context.getPackageName();
|
||||||
PackageInfo info = context.getPackageManager().getPackageInfo(packageName, 0);
|
PackageInfo info = context.getPackageManager().getPackageInfo(packageName, 0);
|
||||||
version = "Version " + info.versionName;
|
version = "Version " + info.versionName;
|
||||||
|
|
Loading…
Reference in New Issue