Showing
3 changed files
with
4 additions
and
9 deletions
| @@ -208,7 +208,7 @@ class MobileScannerPlugin : FlutterPlugin, ActivityAware, MethodChannel.MethodCa | @@ -208,7 +208,7 @@ class MobileScannerPlugin : FlutterPlugin, ActivityAware, MethodChannel.MethodCa | ||
| 208 | handler!!.stop() | 208 | handler!!.stop() |
| 209 | result.success(null) | 209 | result.success(null) |
| 210 | } catch (e: AlreadyStopped) { | 210 | } catch (e: AlreadyStopped) { |
| 211 | - result.error("MobileScanner", "Called stop() while already stopped!", null) | 211 | + result.success(null) |
| 212 | } | 212 | } |
| 213 | } | 213 | } |
| 214 | 214 |
| @@ -107,11 +107,7 @@ public class SwiftMobileScannerPlugin: NSObject, FlutterPlugin { | @@ -107,11 +107,7 @@ public class SwiftMobileScannerPlugin: NSObject, FlutterPlugin { | ||
| 107 | private func stop(_ result: @escaping FlutterResult) { | 107 | private func stop(_ result: @escaping FlutterResult) { |
| 108 | do { | 108 | do { |
| 109 | try mobileScanner.stop() | 109 | try mobileScanner.stop() |
| 110 | - } catch { | ||
| 111 | - result(FlutterError(code: "MobileScanner", | ||
| 112 | - message: "Called stop() while already stopped!", | ||
| 113 | - details: nil)) | ||
| 114 | - } | 110 | + } catch {} |
| 115 | result(nil) | 111 | result(nil) |
| 116 | } | 112 | } |
| 117 | 113 |
| @@ -260,9 +260,8 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler, | @@ -260,9 +260,8 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler, | ||
| 260 | 260 | ||
| 261 | func stop(_ result: FlutterResult) { | 261 | func stop(_ result: FlutterResult) { |
| 262 | if (device == nil) { | 262 | if (device == nil) { |
| 263 | - result(FlutterError(code: "MobileScanner", | ||
| 264 | - message: "Called stop() while already stopped!", | ||
| 265 | - details: nil)) | 263 | + result(nil) |
| 264 | + | ||
| 266 | return | 265 | return |
| 267 | } | 266 | } |
| 268 | captureSession.stopRunning() | 267 | captureSession.stopRunning() |
-
Please register or login to post a comment