Check Acces.Root().FindAttribute(...) result in TNaming_Tool::NamedShape and return an empty Handle
if the TNaming_UsedShapes attribute is not found to avoid using an uninitialized map.
Handle(TNaming_NamedShape) TNaming_Tool::NamedShape(const TopoDS_Shape& S, const TDF_Label& Acces)
{
- Handle(TNaming_UsedShapes) US;
- Acces.Root().FindAttribute(TNaming_UsedShapes::GetID(), US);
Handle(TNaming_NamedShape) NS;
+ Handle(TNaming_UsedShapes) US;
+ if (!Acces.Root().FindAttribute(TNaming_UsedShapes::GetID(), US))
+ {
+ return NS;
+ }
if (!TNaming_Tool::HasLabel(US, S))
{