diff --git a/tests/boxplottester/mainwidget.cpp b/tests/boxplottester/mainwidget.cpp index 2f95d14..4890b1f 100644 --- a/tests/boxplottester/mainwidget.cpp +++ b/tests/boxplottester/mainwidget.cpp @@ -366,7 +366,10 @@ void MainWidget::setBrush() if (m_seriesCount > 0) { QList sets = m_series[0]->boxSets(); - sets.at(1)->setBrush(QBrush(QColor(Qt::yellow))); + if (sets.count() > 1) + sets.at(1)->setBrush(QBrush(QColor(Qt::yellow))); + else + qDebug() << "Create a series with at least two items first"; } else { qDebug() << "Create a series first"; }