From: gka Date: Wed, 26 Oct 2016 16:31:49 +0000 (+0300) Subject: 0026524: ShapeFix_Face crash when performing fix on an invalid face. X-Git-Tag: V7_1_0_beta~46 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=320a322080557df3cb644c73b00ba2f45ecccf92;p=occt-copy.git 0026524: ShapeFix_Face crash when performing fix on an invalid face. Check that method Context() returns not null handle was added. --- diff --git a/src/ShapeFix/ShapeFix_Face.cxx b/src/ShapeFix/ShapeFix_Face.cxx index b5bc649e17..9ebadf5504 100644 --- a/src/ShapeFix/ShapeFix_Face.cxx +++ b/src/ShapeFix/ShapeFix_Face.cxx @@ -2459,7 +2459,12 @@ Standard_Boolean ShapeFix_Face::FixSplitFace(const TopTools_DataMapOfShapeListOf for(Standard_Integer i=1; i<=faces.Length(); i++ ) B.Add(Comp,faces(i)); myResult = Comp; - Context()->Replace ( myFace, myResult ); + + if(!Context().IsNull()) + { + Context()->Replace ( myFace, myResult ); + } + for (TopExp_Explorer exp ( myResult, TopAbs_FACE ); exp.More(); exp.Next() ) { myFace = TopoDS::Face ( exp.Current() ); BRepTools::Update(myFace);