Fix crash if a piece contour is empty.

This commit is contained in:
Roman Telezhynskyi 2021-03-30 18:21:02 +03:00
parent b2e75261b7
commit 453736dfbc

View File

@ -1929,12 +1929,15 @@ QPainterPath VAbstractPiece::PainterPath(const QVector<QPointF> &points)
QPainterPath path; QPainterPath path;
path.setFillRule(Qt::WindingFill); path.setFillRule(Qt::WindingFill);
path.moveTo(points.at(0)); if (not points.isEmpty())
for (qint32 i = 1; i < points.count(); ++i)
{ {
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; return path;
} }