diff --git a/src/XSControl/XSControl_WorkSession.cxx b/src/XSControl/XSControl_WorkSession.cxx index 1f8caedac7..0ffc9fdc3e 100644 --- a/src/XSControl/XSControl_WorkSession.cxx +++ b/src/XSControl/XSControl_WorkSession.cxx @@ -458,7 +458,10 @@ IFSelect_ReturnStatus XSControl_WorkSession::TransferWriteShape (const TopoDS_Sh IFSelect_ReturnStatus status; if (myController.IsNull()) return IFSelect_RetError; const Handle(Interface_InterfaceModel) &model = Model(); - if (model.IsNull()) return IFSelect_RetVoid; + if (model.IsNull() || shape.IsNull()) + { + return IFSelect_RetVoid; + } status = myTransferWriter->TransferWriteShape (model,shape); // qui s occupe de tout, try/catch inclus diff --git a/tests/bugs/step/bug27070 b/tests/bugs/step/bug27070 new file mode 100644 index 0000000000..250204c301 --- /dev/null +++ b/tests/bugs/step/bug27070 @@ -0,0 +1,8 @@ +puts "# =======================================================================" +puts "# 0027070: Segfault when transferring HLR-created shapes via STEPControl_Writer" +puts "# =======================================================================" +puts "" + +puts "Check that writing null shape does not produce access violation" +puts "REQUIRED ALL: Error: translation failed, status = 0" +stepwrite a a