Commit a09b3ab0 authored by David Redondo's avatar David Redondo 🏎
Browse files

Allow constructing sensor from first entry in query

parent 04e96f66
......@@ -64,7 +64,7 @@ Sensor::Sensor(const QString &id, QObject *parent)
Sensor::Sensor(const SensorQuery &query, int index, QObject *parent)
: Sensor(QString{}, parent)
{
if (index > 0 && index < query.result().size()) {
if (index >= 0 && index < query.result().size()) {
auto result = query.result().at(index);
d->id = result.first;
onMetaDataChanged(d->id, result.second);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment