Fix crash in QCameraInfo when no camera is available on the system.
Change-Id: I04bea9d6afcf567c64788c3765cc6626dc9cd482 Reviewed-by: Christian Stromme <christian.stromme@digia.com>
This commit is contained in:
committed by
The Qt Project
parent
7272efc936
commit
eec1381606
@@ -104,7 +104,7 @@ QCameraInfo::QCameraInfo(const QCamera &camera)
|
||||
: d(new QCameraInfoPrivate)
|
||||
{
|
||||
const QVideoDeviceSelectorControl *deviceControl = camera.d_func()->deviceControl;
|
||||
if (deviceControl) {
|
||||
if (deviceControl && deviceControl->deviceCount() > 0) {
|
||||
const int selectedDevice = deviceControl->selectedDevice();
|
||||
d->deviceName = deviceControl->deviceName(selectedDevice);
|
||||
d->description = deviceControl->deviceDescription(selectedDevice);
|
||||
|
||||
Reference in New Issue
Block a user