diff --git a/core/paintbuffermodel.cpp b/core/paintbuffermodel.cpp index 035e3d356..468717eb4 100644 --- a/core/paintbuffermodel.cpp +++ b/core/paintbuffermodel.cpp @@ -135,7 +135,7 @@ PaintBuffer PaintBufferModel::buffer() const void PaintBufferModel::setCosts(const QVector &costs) { m_costs = costs; - if (rowCount() > 0) { + if (rowCount() > 0 && !m_costs.isEmpty()) { m_maxCost = *std::max_element(m_costs.constBegin(), m_costs.constEnd()); emit dataChanged(index(0, 2, QModelIndex()), index(rowCount() - 1, 2, QModelIndex())); }