Fix bug #13883976 Settings crash on long-tapping and swiping in Language & Input screen

- fix potential NPE

Change-Id: I12045f420d5b2a4f349e59a04141153cd2e46378
This commit is contained in:
Fabrice Di Meglio
2014-04-08 13:56:06 -07:00
parent e5687b1b32
commit 821a0729ad

View File

@@ -740,8 +740,11 @@ public class SettingsActivity extends Activity
String title; String title;
if (titleRes > 0) { if (titleRes > 0) {
title = getString(titleRes); title = getString(titleRes);
} else { } else if (titleText != null) {
title = titleText.toString(); title = titleText.toString();
} else {
// There not much we can do in that case
title = "";
} }
startWithFragment(fragmentClass, args, resultTo, resultRequestCode, title); startWithFragment(fragmentClass, args, resultTo, resultRequestCode, title);
} }