diff --git a/ios/Classes/NfcInFlutterPlugin.m b/ios/Classes/NfcInFlutterPlugin.m index c9c0694..cf4e46e 100644 --- a/ios/Classes/NfcInFlutterPlugin.m +++ b/ios/Classes/NfcInFlutterPlugin.m @@ -134,7 +134,9 @@ - (FlutterError * _Nullable)onListenWithArguments:(id _Nullable)arguments eventS // the reader session if activate - (FlutterError * _Nullable)onCancelWithArguments:(id _Nullable)arguments { if (session != nil) { - [session invalidateSession]; + if ([session isReady]) { + [session invalidateSession]; + } session = nil; } events = nil;