Daniel Newton

add some null handling

... ... @@ -146,7 +146,7 @@ class MobileScannerWebPlugin {
'torchable': hasFlash
};
} catch (e) {
throw PlatformException(code: 'MobileScannerWeb', message: e.toString());
throw PlatformException(code: 'MobileScannerWeb', message: '$e');
}
}
... ... @@ -166,7 +166,7 @@ class MobileScannerWebPlugin {
Future<void> cancel() async {
try {
// Stop the camera stream
_localStream!.getTracks().forEach((track) {
_localStream?.getTracks().forEach((track) {
if (track.readyState == 'live') {
track.stop();
}
... ...