From 9e4c2fbb29ed7479ddeb6b4a0fa31402fea295d6 Mon Sep 17 00:00:00 2001 From: Pawel Date: Fri, 13 Jul 2012 17:31:19 +0400 Subject: [PATCH] 0023261: Checking handle value against NULL Checking handles using the IsNull() method. Minor correction of compilation error (missing parentheses in function call) --- src/NIS/NIS_Surface.cxx | 2 +- src/ViewerTest/ViewerTest_ViewerCommands.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/NIS/NIS_Surface.cxx b/src/NIS/NIS_Surface.cxx index b59eb0071d..c51e3ba370 100755 --- a/src/NIS/NIS_Surface.cxx +++ b/src/NIS/NIS_Surface.cxx @@ -486,7 +486,7 @@ void NIS_Surface::SetDisplayMode (const NIS_Surface::DisplayMode theMode) isUpdate = Standard_True; } } - if (isUpdate && GetDrawer()) { + if (isUpdate && !GetDrawer().IsNull()) { const Handle(NIS_SurfaceDrawer) aDrawer = static_cast(DefaultDrawer(0L)); aDrawer->Assign (GetDrawer()); diff --git a/src/ViewerTest/ViewerTest_ViewerCommands.cxx b/src/ViewerTest/ViewerTest_ViewerCommands.cxx index 9f0996999e..d634c029ad 100755 --- a/src/ViewerTest/ViewerTest_ViewerCommands.cxx +++ b/src/ViewerTest/ViewerTest_ViewerCommands.cxx @@ -2425,7 +2425,7 @@ V3d_LineItem::V3d_LineItem(Standard_Real X1, Standard_Real Y1, myX1(X1), myY1(Y1), myX2(X2), myY2(Y2), myLayerMgr(theLayerMgr), myType(theType), myWidth(theWidth), myTransparency(theTransp) { - if (myLayerMgr && myLayerMgr->Overlay()) + if (myLayerMgr && !myLayerMgr->Overlay().IsNull()) myLayerMgr->Overlay()->AddLayerItem (this); }