Skip to content

Commit

Permalink
No need to crash when a user wants a highlight
Browse files Browse the repository at this point in the history
Fix #17413
  • Loading branch information
m-kuhn committed Nov 8, 2017
1 parent ccd142f commit dc7ec1e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gui/qgshighlight.cpp
Expand Up @@ -242,7 +242,7 @@ void QgsHighlight::paintPolygon( QPainter *p, const QgsPolygonXY &polygon )
{
//adding point only if it is more than a pixel apart from the previous one
const QPointF curVertex = toCanvasCoordinates( sourceVertex ) - pos();
if ( std::abs( ring.back().x() - curVertex.x() ) > 1 || std::abs( ring.back().y() - curVertex.y() ) > 1 )
if ( ring.isEmpty() || std::abs( ring.back().x() - curVertex.x() ) > 1 || std::abs( ring.back().y() - curVertex.y() ) > 1 )
{
ring.push_back( curVertex );
}
Expand Down

0 comments on commit dc7ec1e

Please sign in to comment.