diff --git a/src/libs/vlayout/vabstractpiece.cpp b/src/libs/vlayout/vabstractpiece.cpp index 66efcbe6c..3e0b2093c 100644 --- a/src/libs/vlayout/vabstractpiece.cpp +++ b/src/libs/vlayout/vabstractpiece.cpp @@ -1929,12 +1929,15 @@ QPainterPath VAbstractPiece::PainterPath(const QVector &points) QPainterPath path; path.setFillRule(Qt::WindingFill); - path.moveTo(points.at(0)); - for (qint32 i = 1; i < points.count(); ++i) + if (not points.isEmpty()) { - path.lineTo(points.at(i)); + path.moveTo(points.at(0)); + for (qint32 i = 1; i < points.count(); ++i) + { + path.lineTo(points.at(i)); + } + path.lineTo(points.at(0)); } - path.lineTo(points.at(0)); return path; }