summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/java/android/nfc/NfcAdapter.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/java/android/nfc/NfcAdapter.java b/core/java/android/nfc/NfcAdapter.java
index a9f1685..2857ac5 100644
--- a/core/java/android/nfc/NfcAdapter.java
+++ b/core/java/android/nfc/NfcAdapter.java
@@ -360,6 +360,10 @@ public final class NfcAdapter {
/* use getSystemService() instead of just instantiating to take
* advantage of the context's cached NfcManager & NfcAdapter */
NfcManager manager = (NfcManager) context.getSystemService(Context.NFC_SERVICE);
+ if (manager == null) {
+ // NFC not available
+ return null;
+ }
return manager.getDefaultAdapter();
}