summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJuha Vuolle <juha.vuolle@insta.fi>2021-06-17 12:49:06 +0300
committerJuha Vuolle <juha.vuolle@insta.fi>2021-06-22 13:45:29 +0300
commitb34c7bcc40b07e6c88593d49196f91f1075f9bb2 (patch)
tree54d70aff1c808d6599fdbf8e458dcb342e227953 /tests
parent07155b638ec9e6383e05f054c71da24a199bf11e (diff)
Fix crash in manual test (sensor explorer)
In some cases the reading may be a nullptr and the test needs to prepare for it. Pick-to: 6.2 Task-number: QTBUG-92513 Change-Id: I0186ffe9b277c9b978a30b4001c31df350a5d7a8 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/manual/sensor_explorer/explorer.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/manual/sensor_explorer/explorer.cpp b/tests/manual/sensor_explorer/explorer.cpp
index 112829c7..48cc76f5 100644
--- a/tests/manual/sensor_explorer/explorer.cpp
+++ b/tests/manual/sensor_explorer/explorer.cpp
@@ -158,6 +158,8 @@ void Explorer::loadReading()
{
// Probe the reading using Qt's meta-object facilities
QSensorReading *reading = m_sensor->reading();
+ if (!reading)
+ return;
const QMetaObject *mo = reading->metaObject();
int firstProperty = QSensorReading::staticMetaObject.propertyOffset();