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:
smparkes@smparkes.net 2011-05-22 23:10:45 +00:00
parent edc0f987d0
commit 9371cc2930

View file

@ -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 {