mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-05 18:16:23 +03:00
0026120: Visualization - segmentation fault in AIS_Selection
Added NULL-pointer checks
This commit is contained in:
parent
b3c433fea3
commit
8d64c0cc40
@ -230,6 +230,10 @@ void AIS_Selection::ClearAndSelect(const Handle(Standard_Transient)& anObject) {
|
||||
Standard_Integer AIS_Selection::Extent() {
|
||||
Handle(AIS_Selection) S;
|
||||
AIS_Sel_CurrentSelection (S);
|
||||
|
||||
if (S.IsNull())
|
||||
return 0;
|
||||
|
||||
return S->myresult.Extent();
|
||||
}
|
||||
|
||||
@ -241,7 +245,10 @@ Handle(Standard_Transient) AIS_Selection::Single()
|
||||
{
|
||||
Handle(AIS_Selection) S;
|
||||
AIS_Sel_CurrentSelection (S);
|
||||
|
||||
|
||||
if (S.IsNull())
|
||||
return Handle(Standard_Transient)();
|
||||
|
||||
S->Init();
|
||||
return S->Value();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user