Fix SEGV when REST API is called for non existing sensor id
@@ -653,7 +653,7 @@ int DeRestPluginPrivate::changeSensorConfig(const ApiRequest &req, ApiResponse &
TaskItem task;
QString id = req.path[3];
Sensor *sensor = id.length() < MIN_UNIQUEID_LENGTH ? getSensorNodeForId(id) : getSensorNodeForUniqueId(id);
- Device *device = sensor->parentResource() ? static_cast<Device*>(sensor->parentResource()) : nullptr;
+ Device *device = (sensor && sensor->parentResource()) ? static_cast<Device*>(sensor->parentResource()) : nullptr;
bool ok;
bool updated;
bool save = false;
