Skip to content

Commit

Permalink
fix: #9 crash when use useAppleVision in iOS Simulator
Browse files Browse the repository at this point in the history
  • Loading branch information
howljs committed Mar 13, 2024
1 parent 777c8c5 commit 81088e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ios/AppleVision/CameraView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ final class CameraView: UIView {
}

func setTorchOn(mode: AVCaptureDevice.TorchMode) {
if(vDevice.hasTorch && vDevice.hasFlash) {
if(vDevice != nil && vDevice.hasTorch && vDevice.hasFlash) {
do {
try vDevice.lockForConfiguration()
vDevice.torchMode = mode
Expand Down

0 comments on commit 81088e6

Please sign in to comment.