diff options
6 files changed, 7 insertions, 7 deletions
diff --git a/src/plugins/sensors/winrt/winrtaccelerometer.cpp b/src/plugins/sensors/winrt/winrtaccelerometer.cpp index c8e8b26..16261c6 100644 --- a/src/plugins/sensors/winrt/winrtaccelerometer.cpp +++ b/src/plugins/sensors/winrt/winrtaccelerometer.cpp @@ -130,7 +130,7 @@ WinRtAccelerometer::WinRtAccelerometer(QSensor *sensor) } hr = factory->GetDefault(&d->sensor); - if (FAILED(hr)) { + if (FAILED(hr) || !d->sensor) { qCWarning(lcWinRtSensors) << "Unable to get default accelerometer." << qt_error_string(hr); sensorError(hr); diff --git a/src/plugins/sensors/winrt/winrtambientlightsensor.cpp b/src/plugins/sensors/winrt/winrtambientlightsensor.cpp index 18ee641..33bbac1 100644 --- a/src/plugins/sensors/winrt/winrtambientlightsensor.cpp +++ b/src/plugins/sensors/winrt/winrtambientlightsensor.cpp @@ -129,7 +129,7 @@ WinRtAmbientLightSensor::WinRtAmbientLightSensor(QSensor *sensor) } hr = factory->GetDefault(&d->sensor); - if (FAILED(hr)) { + if (FAILED(hr) || !d->sensor) { qCWarning(lcWinRtSensors) << "Unable to get default light sensor." << qt_error_string(hr); sensorError(hr); diff --git a/src/plugins/sensors/winrt/winrtcompass.cpp b/src/plugins/sensors/winrt/winrtcompass.cpp index bc2430f..6a678e2 100644 --- a/src/plugins/sensors/winrt/winrtcompass.cpp +++ b/src/plugins/sensors/winrt/winrtcompass.cpp @@ -150,8 +150,8 @@ WinRtCompass::WinRtCompass(QSensor *sensor) } hr = factory->GetDefault(&d->sensor); - if (FAILED(hr)) { - qCWarning(lcWinRtSensors) << "Unable to get default light sensor." + if (FAILED(hr) || !d->sensor) { + qCWarning(lcWinRtSensors) << "Unable to get default compass." << qt_error_string(hr); sensorError(hr); return; diff --git a/src/plugins/sensors/winrt/winrtgyroscope.cpp b/src/plugins/sensors/winrt/winrtgyroscope.cpp index dec6512..1e729a1 100644 --- a/src/plugins/sensors/winrt/winrtgyroscope.cpp +++ b/src/plugins/sensors/winrt/winrtgyroscope.cpp @@ -127,7 +127,7 @@ WinRtGyroscope::WinRtGyroscope(QSensor *sensor) } hr = factory->GetDefault(&d->sensor); - if (FAILED(hr)) { + if (FAILED(hr) || !d->sensor) { qCWarning(lcWinRtSensors) << "Unable to get default gyroscope sensor." << qt_error_string(hr); sensorError(hr); diff --git a/src/plugins/sensors/winrt/winrtorientationsensor.cpp b/src/plugins/sensors/winrt/winrtorientationsensor.cpp index 6d85e51..b8c7e81 100644 --- a/src/plugins/sensors/winrt/winrtorientationsensor.cpp +++ b/src/plugins/sensors/winrt/winrtorientationsensor.cpp @@ -135,7 +135,7 @@ WinRtOrientationSensor::WinRtOrientationSensor(QSensor *sensor) } hr = factory->GetDefault(&d->sensor); - if (FAILED(hr)) { + if (FAILED(hr) || !d->sensor) { qCWarning(lcWinRtSensors) << "Unable to get default orientation sensor." << qt_error_string(hr); sensorError(hr); diff --git a/src/plugins/sensors/winrt/winrtrotationsensor.cpp b/src/plugins/sensors/winrt/winrtrotationsensor.cpp index e4e3edc..576545e 100644 --- a/src/plugins/sensors/winrt/winrtrotationsensor.cpp +++ b/src/plugins/sensors/winrt/winrtrotationsensor.cpp @@ -125,7 +125,7 @@ WinRtRotationSensor::WinRtRotationSensor(QSensor *sensor) } hr = factory->GetDefault(&d->sensor); - if (FAILED(hr)) { + if (FAILED(hr) || !d->sensor) { qCWarning(lcWinRtSensors) << "Unable to get default rotation sensor." << qt_error_string(hr); sensorError(hr); |