diff options
Diffstat (limited to 'qt-models/weightmodel.cpp')
-rw-r--r-- | qt-models/weightmodel.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/qt-models/weightmodel.cpp b/qt-models/weightmodel.cpp index ff0b5c87a..4a931a4bb 100644 --- a/qt-models/weightmodel.cpp +++ b/qt-models/weightmodel.cpp @@ -19,14 +19,14 @@ WeightModel::WeightModel(QObject *parent) : CleanerTableModel(parent), connect(&diveListNotifier, &DiveListNotifier::weightRemoved, this, &WeightModel::weightRemoved); } -weightsystem_t *WeightModel::weightSystemAt(const QModelIndex &index) +weightsystem_t WeightModel::weightSystemAt(const QModelIndex &index) { int row = index.row(); if (row < 0 || row >= d->weightsystems.nr) { qWarning("WeightModel: Accessing invalid weightsystem %d (of %d)", row, d->weightsystems.nr); - return nullptr; + return { { 0 }, nullptr }; } - return &d->weightsystems.weightsystems[index.row()]; + return d->weightsystems.weightsystems[index.row()]; } void WeightModel::clear() |