From d3155254bba40236bc1e7ee3764c88e0d32b36cc 2013-10-16 06:49:27 From: Titta Heikkala Date: 2013-10-16 06:49:27 Subject: [PATCH] Fix crash with boxplottertester brush The test sets the brush for the second set in the first series. It is checked that the set exists before setting the brush for it. Change-Id: Id677ab781953bf7cc789f316d92c137873d4f624 Reviewed-by: Miikka Heikkinen --- 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"; }