diff --git a/Gemfile.lock b/Gemfile.lock index d245f4304..d50ddb036 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -300,6 +300,7 @@ GEM PLATFORMS arm64-darwin-21 arm64-darwin-22 + arm64-darwin-23 x86_64-darwin-20 x86_64-darwin-21 x86_64-darwin-22 diff --git a/Sources/App/QRCodeScanner/Camera/BarcodeScannerCamera.swift b/Sources/App/QRCodeScanner/Camera/BarcodeScannerCamera.swift index b5e2b62f9..12d178506 100644 --- a/Sources/App/QRCodeScanner/Camera/BarcodeScannerCamera.swift +++ b/Sources/App/QRCodeScanner/Camera/BarcodeScannerCamera.swift @@ -33,7 +33,7 @@ class BarcodeScannerCamera: NSObject { private var captureDevice: AVCaptureDevice? { didSet { - guard let captureDevice = captureDevice else { return } + guard let captureDevice else { return } Current.Log.info("Using capture device: \(captureDevice.localizedName)") sessionQueue.async { self.updateSessionForCaptureDevice(captureDevice) @@ -79,7 +79,7 @@ class BarcodeScannerCamera: NSObject { } guard - let captureDevice = captureDevice, + let captureDevice, let deviceInput = try? AVCaptureDeviceInput(device: captureDevice) else { Current.Log.error("Failed to obtain video input.") return @@ -199,14 +199,14 @@ class BarcodeScannerCamera: NSObject { if isCaptureSessionConfigured { if !captureSession.isRunning { sessionQueue.async { [self] in - self.captureSession.startRunning() + captureSession.startRunning() } } return } sessionQueue.async { [self] in - self.configureCaptureSession { success in + configureCaptureSession { success in guard success else { return } self.captureSession.startRunning() }