From 8260fb1437d7467c95dac0bdf1e3710fbd05d9bc Mon Sep 17 00:00:00 2001 From: Eric House Date: Sun, 24 Nov 2013 18:13:54 -0800 Subject: [PATCH] fix NPE on older phones --- .../android/XWords4/src/org/eehouse/android/xw4/NFCUtils.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/NFCUtils.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/NFCUtils.java index b9f3a8700..39b04afd6 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/NFCUtils.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/NFCUtils.java @@ -76,7 +76,9 @@ public class NFCUtils { NfcManager manager = (NfcManager)activity.getSystemService( Context.NFC_SERVICE ); NfcAdapter adapter = manager.getDefaultAdapter(); - adapter.setNdefPushMessageCallback( cb, activity ); + if ( null != adapter ) { + adapter.setNdefPushMessageCallback( cb, activity ); + } } }