mirror of
https://github.com/zxing/zxing.git
synced 2025-01-27 11:01:00 -08:00
don't crash on devices without a camera
git-svn-id: https://zxing.googlecode.com/svn/trunk@1797 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
edc0f987d0
commit
9371cc2930
|
@ -120,12 +120,16 @@
|
|||
ZXCaptureDevice* zxd = [self device];
|
||||
ZXQT([zxd open:nil]);
|
||||
|
||||
input =
|
||||
[ZXCaptureDeviceInput deviceInputWithDevice:zxd
|
||||
ZXAV(error:nil)];
|
||||
[input retain];
|
||||
if (zxd) {
|
||||
input =
|
||||
[ZXCaptureDeviceInput deviceInputWithDevice:zxd
|
||||
ZXAV(error:nil)];
|
||||
[input retain];
|
||||
}
|
||||
|
||||
[session addInput:input ZXQT(error:nil)];
|
||||
if (input) {
|
||||
[session addInput:input ZXQT(error:nil)];
|
||||
}
|
||||
}
|
||||
|
||||
- (ZXCaptureSession*)session {
|
||||
|
|
Loading…
Reference in a new issue