X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGEOMAlgo%2FGEOMAlgo_AlgoTools.cxx;h=511de81ac96ee2a30a0651075a171dd8a99c5035;hb=f7a34e70811b846a2878ed84d1c973dd935b82b3;hp=baa1ce94cb35304c5769c2a3829aae3c583a4835;hpb=5a3993c7b06b1f7b0d79e66af3411d9982cf2b62;p=modules%2Fgeom.git diff --git a/src/GEOMAlgo/GEOMAlgo_AlgoTools.cxx b/src/GEOMAlgo/GEOMAlgo_AlgoTools.cxx index baa1ce94c..511de81ac 100644 --- a/src/GEOMAlgo/GEOMAlgo_AlgoTools.cxx +++ b/src/GEOMAlgo/GEOMAlgo_AlgoTools.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2022 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -1292,6 +1292,13 @@ gp_Pnt GetMidPnt2d(const TopoDS_Face& theFace, const TopoDS_Edge& anEdge = aWexp.Current(); if (!aUsedEmap.Add(anEdge)) continue; BRepAdaptor_Curve2d aBAcurve2d (anEdge, theFace); + // Initialization of curve could fail in constructor, + // so we need to check if we actually have a curve here. + if (!aBAcurve2d.Curve()) + { + continue; + } + Standard_Real aDelta = (aBAcurve2d.LastParameter() - aBAcurve2d.FirstParameter())/aNbSamples; for (Standard_Integer ii = 0; ii < aNbSamples; ii++) {