0023261: Checking handle value against NULL
authorPawel <pawel-kowalski@wp.pl>
Fri, 13 Jul 2012 13:31:19 +0000 (17:31 +0400)
committerPawel <pawel-kowalski@wp.pl>
Fri, 13 Jul 2012 13:31:19 +0000 (17:31 +0400)
Checking handles using the IsNull() method.
Minor correction of compilation error (missing parentheses in function call)

src/NIS/NIS_Surface.cxx
src/ViewerTest/ViewerTest_ViewerCommands.cxx

index b59eb0071d91b42fe23536db0b1c469e223f63ef..c51e3ba3708e8ef90db82575cddc1f749e6548fc 100755 (executable)
@@ -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<NIS_SurfaceDrawer *>(DefaultDrawer(0L));
     aDrawer->Assign (GetDrawer());
index 9f0996999e87f1f2da7782cdebf40f674b63a289..d634c029ad144a9f00c7646c00e44bebf048d7e7 100755 (executable)
@@ -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);
 }