From 367759e86c030f466d6ac6cf01aaaaebb0b522d5 Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 13 Jun 2023 20:00:59 +1000 Subject: [PATCH] Ignore barcode resume if not mounted (#371) --- lib/barcode/camera_controller.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/barcode/camera_controller.dart b/lib/barcode/camera_controller.dart index d7147ce7..94031e8d 100644 --- a/lib/barcode/camera_controller.dart +++ b/lib/barcode/camera_controller.dart @@ -71,6 +71,12 @@ class _CameraBarcodeControllerState extends InvenTreeBarcodeControllerState { @override Future resumeScan() async { + + // Do not attempt to resume if the widget is not mounted + if (!mounted) { + return; + } + try { await _controller?.resumeCamera(); } on CameraException {