diff --git a/src/meshTools/triSurface/surfaceFeatures/surfaceFeatures.C b/src/meshTools/triSurface/surfaceFeatures/surfaceFeatures.C
index 8da032518b1ed182c9021b5df8ff35d6d01c50e6..7877bdfc2d29ef501c15ec80657cd0e344f8562d 100644
--- a/src/meshTools/triSurface/surfaceFeatures/surfaceFeatures.C
+++ b/src/meshTools/triSurface/surfaceFeatures/surfaceFeatures.C
@@ -243,12 +243,16 @@ void Foam::surfaceFeatures::calcFeatPoints
 
                 if (edgeStat[edgeI] != NONE)
                 {
-                    edgeVecs.append(edges[edgeI].vec(localPoints));
-                    edgeVecs.last() /= mag(edgeVecs.last());
+                    vector vec = edges[edgeI].vec(localPoints);
+                    scalar magVec = mag(vec);
+                    if (magVec > SMALL)
+                    {
+                        edgeVecs.append(vec/magVec);
+                    }
                 }
             }
 
-            if (mag(edgeVecs[0] & edgeVecs[1]) < minCos)
+            if (edgeVecs.size() == 2 && mag(edgeVecs[0] & edgeVecs[1]) < minCos)
             {
                 featurePoints.append(pointi);
             }