From b1c235dfce079a069881cbc260575dc083c7426c Mon Sep 17 00:00:00 2001 From: kgv Date: Tue, 19 Sep 2017 10:02:37 +0300 Subject: [PATCH] 0029062: Visualization, SelectMgr_ViewerSelector - add NULL-check within ::checkOverlap() method --- src/SelectMgr/SelectMgr_ViewerSelector.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/SelectMgr/SelectMgr_ViewerSelector.cxx b/src/SelectMgr/SelectMgr_ViewerSelector.cxx index 2d3cabfbb2..eed1b3fc9b 100644 --- a/src/SelectMgr/SelectMgr_ViewerSelector.cxx +++ b/src/SelectMgr/SelectMgr_ViewerSelector.cxx @@ -177,6 +177,9 @@ void SelectMgr_ViewerSelector::checkOverlap (const Handle(SelectBasics_Sensitive if (!anOwner.IsNull()) { aSelectable = anOwner->Selectable(); + } + if (!aSelectable.IsNull()) + { if (!aSelectable->ClipPlanes().IsNull() && aSelectable->ClipPlanes()->ToOverrideGlobal()) { @@ -231,6 +234,7 @@ void SelectMgr_ViewerSelector::checkOverlap (const Handle(SelectBasics_Sensitive } if (HasDepthClipping (anOwner) + && !aSelectable.IsNull() && theMgr.GetActiveSelectionType() == SelectMgr_SelectingVolumeManager::Point) { Standard_Boolean isClipped = mySelectingVolumeMgr.IsClipped (*aSelectable->ClipPlanes(), @@ -240,7 +244,7 @@ void SelectMgr_ViewerSelector::checkOverlap (const Handle(SelectBasics_Sensitive } SelectMgr_SortCriterion aCriterion; - myZLayerOrderMap.Find (aSelectable->ZLayer(), aCriterion.ZLayerPosition); + myZLayerOrderMap.Find (!aSelectable.IsNull() ? aSelectable->ZLayer() : Graphic3d_ZLayerId_Default, aCriterion.ZLayerPosition); aCriterion.Entity = theEntity; aCriterion.Priority = anOwner->Priority(); aCriterion.Depth = aPickResult.Depth();