mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-05-16 10:54:53 +03:00
0025153: Retrieval of arguments of selection crashes the application
A check on NULL is added into TDF_Tool::OutReferences() static methods. Test cases for issue CR25153
This commit is contained in:
parent
73920cd481
commit
d91b3986ed
@ -248,7 +248,10 @@ static void TDF_Tool_OutReferers(const TDF_Label& aRefLabel,
|
|||||||
// const Handle(TDF_Attribute)& att = attMItr.Key();
|
// const Handle(TDF_Attribute)& att = attMItr.Key();
|
||||||
Handle(TDF_Attribute) att = attMItr.Key();
|
Handle(TDF_Attribute) att = attMItr.Key();
|
||||||
// ENDCLE
|
// ENDCLE
|
||||||
if (aFilterForReferences.IsKept(att) && !att->Label().IsDescendant(aRefLabel)) {
|
if (aFilterForReferences.IsKept(att) &&
|
||||||
|
!att->Label().IsNull() &&
|
||||||
|
!att->Label().IsDescendant(aRefLabel))
|
||||||
|
{
|
||||||
atts.Add(itr.Value());
|
atts.Add(itr.Value());
|
||||||
outRefFound = Standard_True;
|
outRefFound = Standard_True;
|
||||||
break;
|
break;
|
||||||
@ -318,7 +321,10 @@ static void TDF_Tool_OutReferences(const TDF_Label& aRefLabel,
|
|||||||
const TDF_AttributeMap& attMap = ds->Attributes();
|
const TDF_AttributeMap& attMap = ds->Attributes();
|
||||||
for (TDF_MapIteratorOfAttributeMap attMItr(attMap);attMItr.More();attMItr.Next()) {
|
for (TDF_MapIteratorOfAttributeMap attMItr(attMap);attMItr.More();attMItr.Next()) {
|
||||||
Handle(TDF_Attribute) att = attMItr.Key();
|
Handle(TDF_Attribute) att = attMItr.Key();
|
||||||
if (aFilterForReferences.IsKept(att) && !att->Label().IsDescendant(aRefLabel)) {
|
if (aFilterForReferences.IsKept(att) &&
|
||||||
|
!att->Label().IsNull() &&
|
||||||
|
!att->Label().IsDescendant(aRefLabel))
|
||||||
|
{
|
||||||
atts.Add(att);
|
atts.Add(att);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
16
tests/bugs/caf/bug25153
Normal file
16
tests/bugs/caf/bug25153
Normal file
@ -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
|
Loading…
x
Reference in New Issue
Block a user