View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0026564 | Community | OCCT:Modeling Algorithms | public | 2015-08-16 20:11 | 2015-08-16 20:11 |
Reporter | srlockley | Assigned To | |||
Priority | normal | Severity | crash | ||
Status | new | Resolution | open | ||
Platform | Windows | OS | VC++ 2013 | ||
Product Version | 6.9.0 | ||||
Summary | 0026564: Unhandled null pointer in BRep_Tool.cxx | ||||
Description | I have several models that the BRep paving has problems with and they cause a crash in the Tolerance function of BRep_Tool. It is suggested to test that the shape is not null before de-referencing the potentially null pointer with p = (*((Handle(BRep_TFace)*)&F.TShape()))->Tolerance(); The following revision handles the problem and prevents a crash, but I am unsure why the null shape arrives in the first place Standard_Real BRep_Tool::Tolerance(const TopoDS_Face& F) { Standard_Real pMin = Precision::Confusion(); Standard_Real p = pMin; if ((*((Handle(BRep_TFace)*)&F.TShape())) != nullptr) p = (*((Handle(BRep_TFace)*)&F.TShape()))->Tolerance(); else Standard_ConstructionError::Raise("TopoDS_Face::TShape is null"); if (p > pMin) return p; else return pMin; } | ||||
Tags | No tags attached. | ||||
Test case number | |||||