From: Pawel Date: Fri, 13 Jul 2012 13:31:19 +0000 (+0400) Subject: 0023261: Checking handle value against NULL X-Git-Tag: V6_5_4_beta1~135 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=9e4c2fbb29ed7479ddeb6b4a0fa31402fea295d6;p=occt-copy.git 0023261: Checking handle value against NULL Checking handles using the IsNull() method. Minor correction of compilation error (missing parentheses in function call) --- 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); }