Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
mobile_scanner
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Julian Steenbakker
2022-02-23 13:17:02 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
26a5091a229a4b97e3e0c872cf034c3d451240c7
26a5091a
1 parent
5b0f3a72
bug: fix crash on macOS when no camera is available
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
macos/Classes/MobileScannerPlugin.swift
macos/Classes/MobileScannerPlugin.swift
View file @
26a5091
...
...
@@ -185,6 +185,13 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler,
device
=
AVCaptureDevice
.
devices
(
for
:
.
video
)
.
filter
({
$0
.
position
==
position
})
.
first
}
if
(
device
==
nil
)
{
result
(
FlutterError
(
code
:
"MobileScanner"
,
message
:
"No camera found!"
,
details
:
nil
))
return
}
// Enable the torch if parameter is set and torch is available
if
(
device
.
hasTorch
)
{
do
{
...
...
Please
register
or
login
to post a comment