Guard tag object beeing null
@@ -206,6 +206,9 @@ public final class IOSNFCCard extends AbstractNFCCard {
NFCISO7816APDU isoapdu = new NFCISO7816APDU(new NSData(apdu));
Promise<byte[]> p = new Promise<>();
+ if (tag == null) {
+ throw new NullPointerException("Cannot transceive because the tag is null.");
+ }
tag.sendCommandAPDU(isoapdu, (NSData resp, Byte sw1, Byte sw2, NSError er2) -> {
if (er2 != null) {
p.deliver(null);
