浏览代码

Nil safe scanning for iOS

flutter-beta
Alexei 6 年前
committed by Dominik Spicher
父节点
当前提交
24e8670753
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. +4
    -2
      ios/Classes/QRView.swift

+ 4
- 2
ios/Classes/QRView.swift 查看文件

@@ -26,8 +26,10 @@ public class QRView:NSObject,FlutterPlatformView {
try scanner?.startScanning(resultBlock: { codes in
if let codes = codes {
for code in codes {
let stringValue = code.stringValue!
self.channel.invokeMethod("onRecognizeQR", arguments: stringValue)
if (code != nil && code.stringValue != nil) {
let stringValue = code.stringValue!
self.channel.invokeMethod("onRecognizeQR", arguments: stringValue)
}
}
}
})


正在加载...
取消
保存