0029739: Draw Harness - vdonly does not hide displayed objects
[occt.git] / src / ViewerTest / ViewerTest.cxx
index a81276b..6f53cd3 100644 (file)
@@ -2956,7 +2956,7 @@ static int VDonly2 (Draw_Interpretor& ,
     }
 
     const Handle(AIS_InteractiveObject) aShape = Handle(AIS_InteractiveObject)::DownCast (anIter.Key1());
-    if (aShape.IsNull())
+    if (!aShape.IsNull())
     {
       aCtx->Erase (aShape, Standard_False);
     }
@@ -3863,7 +3863,11 @@ Standard_Integer VTexture (Draw_Interpretor& theDi, Standard_Integer theArgsNb,
       {
         aTextureVecNew.SetValue (aTexIndex, Handle(Graphic3d_Texture2Dmanual)());
       }
-      aTextureVecNew.ChangeValue (aTexIndex)->GetParams()->SetTextureUnit ((Graphic3d_TextureUnit )aTexIndex);
+
+      if (aTextureVecNew.Value (aTexIndex))
+      {
+        aTextureVecNew.ChangeValue(aTexIndex)->GetParams()->SetTextureUnit((Graphic3d_TextureUnit)aTexIndex);
+      }
     }
     else
     {