From a722df94150a6efd33fd556c4eba14ca8463802d Mon Sep 17 00:00:00 2001 From: Julian Steenbakker Date: Thu, 25 Mar 2021 10:25:24 +0100 Subject: [PATCH] bug: fixed cast --- lib/src/qr_code_scanner.dart | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/src/qr_code_scanner.dart b/lib/src/qr_code_scanner.dart index 793cd47..a4d6207 100644 --- a/lib/src/qr_code_scanner.dart +++ b/lib/src/qr_code_scanner.dart @@ -304,9 +304,11 @@ class QRViewController { Future getSystemFeatures() async { try { var features = - await (_channel.invokeMapMethod('getSystemFeatures') - as FutureOr>); - return SystemFeatures.fromJson(features); + await _channel.invokeMapMethod('getSystemFeatures'); + if (features != null) { + return SystemFeatures.fromJson(features); + } + throw CameraException('Error', 'Could not get system features'); } on PlatformException catch (e) { throw CameraException(e.code, e.message); }