From 9fce04f9d6dc254e072f864c0664ac858469a590 Mon Sep 17 00:00:00 2001 From: Andrzej Przedecki Date: Sat, 11 Jun 2022 10:52:47 +0200 Subject: [PATCH] Fixed wrong casting in checkSubscribed method (#368) secures ``` flutter: type 'Future?>' is not a subtype of type 'FutureOr>' in type cast flutter: #0 FlutterInappPurchase.checkSubscribed (package:flutter_inapp_purchase/flutter_inapp_purchase.dart:509:39) ``` --- lib/flutter_inapp_purchase.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/flutter_inapp_purchase.dart b/lib/flutter_inapp_purchase.dart index 49a31785..2374ee05 100644 --- a/lib/flutter_inapp_purchase.dart +++ b/lib/flutter_inapp_purchase.dart @@ -542,7 +542,11 @@ class FlutterInappPurchase { }) async { if (_platform.isIOS) { var history = - await (getPurchaseHistory() as FutureOr>); + await (getPurchaseHistory() as Future?>); + + if (history == null) { + return false; + } for (var purchase in history) { Duration difference =