From 5bd179c56ca493a9f1a6fb45f2dbaf59a21a9c51 Mon Sep 17 00:00:00 2001 From: Maksim Shylau Date: Tue, 30 May 2023 14:19:09 +0200 Subject: [PATCH] Bug: fix intents handling when they don't contain NFC tag --- android/src/main/java/community/revteltech/nfc/NfcManager.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/android/src/main/java/community/revteltech/nfc/NfcManager.java b/android/src/main/java/community/revteltech/nfc/NfcManager.java index 986e43e..249d426 100644 --- a/android/src/main/java/community/revteltech/nfc/NfcManager.java +++ b/android/src/main/java/community/revteltech/nfc/NfcManager.java @@ -1315,6 +1315,9 @@ private WritableMap parseNfcIntent(Intent intent) { WritableMap parsed = null; Tag tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG); + if (tag == null) { + return null; + } // Parcelable[] messages = intent.getParcelableArrayExtra((NfcAdapter.EXTRA_NDEF_MESSAGES)); synchronized(this) {