diff --git a/src/core/qgsgeometryvalidator.cpp b/src/core/qgsgeometryvalidator.cpp index 6d4f94e48082..92f6e95b3cb1 100644 --- a/src/core/qgsgeometryvalidator.cpp +++ b/src/core/qgsgeometryvalidator.cpp @@ -65,8 +65,8 @@ void QgsGeometryValidator::checkRingIntersections( int p0, int i0, const QgsLine { d = -distLine2Point( ring1XAtj, ring1YAtj, w.perpVector(), sX, sY ); if ( d > 0 && d < w.length() && - ring0[i + 1] != ring1[j + 1] && ring0[i + 1] != ring1[j] && - ring0[i + 0] != ring1[j + 1] && ring0[i + 0] != ring1[j] ) + ring0->pointN( i + 1 ) != ring1->pointN( j + 1 ) && ring0->pointN( i + 1 ) != ring1->pointN( j ) && + ring0->pointN( i + 0 ) != ring1->pointN( j + 1 ) && ring0->pointN( i + 0 ) != ring1->pointN( j ) ) { QString msg = QObject::tr( "segment %1 of ring %2 of polygon %3 intersects segment %4 of ring %5 of polygon %6 at %7, %8" ) .arg( i0 ).arg( i ).arg( p0 )