From b34c7bcc40b07e6c88593d49196f91f1075f9bb2 Mon Sep 17 00:00:00 2001 From: Juha Vuolle Date: Thu, 17 Jun 2021 12:49:06 +0300 Subject: 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 --- tests/manual/sensor_explorer/explorer.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests') diff --git a/tests/manual/sensor_explorer/explorer.cpp b/tests/manual/sensor_explorer/explorer.cpp index 112829c..48cc76f 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(); -- cgit v1.2.1