We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 1733a3d + a5193b2 commit 63b7360Copy full SHA for 63b7360
core/java/android/nfc/NfcAdapter.java
@@ -360,6 +360,10 @@ public static NfcAdapter getDefaultAdapter(Context context) {
360
/* use getSystemService() instead of just instantiating to take
361
* advantage of the context's cached NfcManager & NfcAdapter */
362
NfcManager manager = (NfcManager) context.getSystemService(Context.NFC_SERVICE);
363
+ if (manager == null) {
364
+ // NFC not available
365
+ return null;
366
+ }
367
return manager.getDefaultAdapter();
368
}
369
0 commit comments