Fix bug #17624121 Settings crash while launching on wiped device

- check for non null reference returned by NfcAdapter.getDefaultAdapter(this)

Change-Id: I88776dbefd351ce1c77cfed6d14b8b2143294488
This commit is contained in:
Fabrice Di Meglio
2014-09-23 11:36:44 -07:00
parent 7e90548836
commit b3c7a179b1

View File

@@ -1177,7 +1177,8 @@ public class SettingsActivity extends Activity
} else { } else {
// Only show if NFC is on and we have the HCE feature // Only show if NFC is on and we have the HCE feature
NfcAdapter adapter = NfcAdapter.getDefaultAdapter(this); NfcAdapter adapter = NfcAdapter.getDefaultAdapter(this);
if (!adapter.isEnabled() || !getPackageManager().hasSystemFeature( if (adapter == null || !adapter.isEnabled() ||
!getPackageManager().hasSystemFeature(
PackageManager.FEATURE_NFC_HOST_CARD_EMULATION)) { PackageManager.FEATURE_NFC_HOST_CARD_EMULATION)) {
removeTile = true; removeTile = true;
} }