Skip to content

Commit 09b6d58

Browse files
committed
Fix crash in arrow symbol layer
1 parent 9df87a6 commit 09b6d58

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/core/symbology-ng/qgsarrowsymbollayer.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -762,13 +762,16 @@ void QgsArrowSymbolLayer::renderPolyline( const QPolygonF& points, QgsSymbolV2Re
762762
{
763763
_resolveDataDefined( context );
764764

765-
// origin point
766-
QPointF po( points.at( 0 ) );
767-
// destination point
768-
QPointF pd( points.back() );
765+
if ( !points.isEmpty() )
766+
{
767+
// origin point
768+
QPointF po( points.at( 0 ) );
769+
// destination point
770+
QPointF pd( points.back() );
769771

770-
QPolygonF poly = straightArrow( po, pd, mScaledArrowStartWidth, mScaledArrowWidth, mScaledHeadWidth, mScaledHeadHeight, mComputedHeadType, mComputedArrowType, mScaledOffset );
771-
mSymbol->renderPolygon( poly, /* rings */ nullptr, context.feature(), context.renderContext() );
772+
QPolygonF poly = straightArrow( po, pd, mScaledArrowStartWidth, mScaledArrowWidth, mScaledHeadWidth, mScaledHeadHeight, mComputedHeadType, mComputedArrowType, mScaledOffset );
773+
mSymbol->renderPolygon( poly, /* rings */ nullptr, context.feature(), context.renderContext() );
774+
}
772775
}
773776
else
774777
{

0 commit comments

Comments
 (0)