From facae1ad357a80859da51f52f49db8c53d2e89be Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Tue, 17 Jun 2014 14:29:19 +0200 Subject: WinRT: Check whether default sensors were obtained successfully In case of an unsuccessful call of the GetDefault function the returned HRESULT does not have the FAILED status but the returned sensor is 0. Task-number: QTBUG-39698 Change-Id: I42a8327c1d7687ab7a8ca71be5a2234b2c4e0b38 Reviewed-by: Andrew Knight --- src/plugins/sensors/winrt/winrtorientationsensor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/sensors/winrt/winrtorientationsensor.cpp') diff --git a/src/plugins/sensors/winrt/winrtorientationsensor.cpp b/src/plugins/sensors/winrt/winrtorientationsensor.cpp index 6d85e51c..b8c7e81d 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); -- cgit v1.2.3