Skip to content

Commit

Permalink
Added the missing code in BasThomas's safe code review.
Browse files Browse the repository at this point in the history
  • Loading branch information
hajunho committed Feb 13, 2024
1 parent f546b1d commit 6550b48
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Sources/WeScan/Scan/CaptureSessionManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ final class CaptureSessionManager: NSObject, AVCaptureVideoDataOutputSampleBuffe
DispatchQueue.global(qos: .userInitiated).async { [weak self] in
self?.captureSession.startRunning()
DispatchQueue.main.async {
self?.isDetecting = true
guard let self = self else { return }
self.isDetecting = true
}
}
case .notDetermined:
Expand All @@ -161,8 +162,9 @@ final class CaptureSessionManager: NSObject, AVCaptureVideoDataOutputSampleBuffe
})
default:
DispatchQueue.main.async { [weak self] in
guard let self = self else { return }
let error = ImageScannerControllerError.authorization
self?.delegate?.captureSessionManager(self!, didFailWithError: error)
self.delegate?.captureSessionManager(self, didFailWithError: error)
}
}
}
Expand Down

0 comments on commit 6550b48

Please sign in to comment.