From 8f454d1f8b44574c8420dd5132e45a371b1f736d 2016-03-02 08:56:50 From: Joni Poikelin Date: 2016-03-02 08:56:50 Subject: [PATCH] Fix crash with empty BarSet values Change-Id: I6c82ad2985f7efc501ed0df34b8205875a369fd0 Task-number: QTBUG-51287 Reviewed-by: Miikka Heikkinen --- diff --git a/src/chartsqml2/declarativebarseries.cpp b/src/chartsqml2/declarativebarseries.cpp index 7d32cfe..526d9af 100644 --- a/src/chartsqml2/declarativebarseries.cpp +++ b/src/chartsqml2/declarativebarseries.cpp @@ -69,7 +69,7 @@ void DeclarativeBarSet::setValues(QVariantList values) while (count()) remove(count() - 1); - if (values.at(0).canConvert(QVariant::Point)) { + if (values.count() > 0 && values.at(0).canConvert(QVariant::Point)) { // Create list of values for appending if the first item is Qt.point int maxValue = 0; for (int i = 0; i < values.count(); i++) {