diff --git a/src/TDF/TDF_Tool.cxx b/src/TDF/TDF_Tool.cxx index 7f19dfea6b..fc7e5767a6 100644 --- a/src/TDF/TDF_Tool.cxx +++ b/src/TDF/TDF_Tool.cxx @@ -248,10 +248,13 @@ static void TDF_Tool_OutReferers(const TDF_Label& aRefLabel, // const Handle(TDF_Attribute)& att = attMItr.Key(); Handle(TDF_Attribute) att = attMItr.Key(); // ENDCLE - if (aFilterForReferences.IsKept(att) && !att->Label().IsDescendant(aRefLabel)) { - atts.Add(itr.Value()); - outRefFound = Standard_True; - break; + if (aFilterForReferences.IsKept(att) && + !att->Label().IsNull() && + !att->Label().IsDescendant(aRefLabel)) + { + atts.Add(itr.Value()); + outRefFound = Standard_True; + break; } } @@ -318,8 +321,11 @@ static void TDF_Tool_OutReferences(const TDF_Label& aRefLabel, const TDF_AttributeMap& attMap = ds->Attributes(); for (TDF_MapIteratorOfAttributeMap attMItr(attMap);attMItr.More();attMItr.Next()) { Handle(TDF_Attribute) att = attMItr.Key(); - if (aFilterForReferences.IsKept(att) && !att->Label().IsDescendant(aRefLabel)) { - atts.Add(att); + if (aFilterForReferences.IsKept(att) && + !att->Label().IsNull() && + !att->Label().IsDescendant(aRefLabel)) + { + atts.Add(att); } } const TDF_LabelMap& labMap = ds->Labels(); diff --git a/tests/bugs/caf/bug25153 b/tests/bugs/caf/bug25153 new file mode 100644 index 0000000000..58c429af56 --- /dev/null +++ b/tests/bugs/caf/bug25153 @@ -0,0 +1,16 @@ +puts "==========" +puts "OCC25123" +puts "==========" +puts "" +################################################### +# Retrieval of arguments of selection crashes the application +################################################### + +plane p 0 0 0 0 0 1 +mkface f p -100 100 -100 100 + +NewDocument D XmlOcaf +ImportShape D 0:1 f +SelectShape D 0:2 f +ForgetAll D 0:1 +ArgsSelection D 0:2