From: jfa Date: Thu, 18 Aug 2005 10:07:02 +0000 (+0000) Subject: Fix pb with contour closure: respect NULL wires list X-Git-Tag: T_3_0_2a1~13 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=150ae4647716a21d0b4797285c67e5a073262512;p=modules%2Fgeom.git Fix pb with contour closure: respect NULL wires list --- diff --git a/src/GEOMImpl/GEOMImpl_IHealingOperations.cxx b/src/GEOMImpl/GEOMImpl_IHealingOperations.cxx index cdf948d8c..08e0c3757 100644 --- a/src/GEOMImpl/GEOMImpl_IHealingOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IHealingOperations.cxx @@ -365,7 +365,10 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::CloseContour SetErrorCode(KO); if (theObject.IsNull()) + { + SetErrorCode("NULL object given"); return NULL; + } Handle(GEOM_Function) aFunction, aLastFunction = theObject->GetLastFunction(); if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be processed @@ -408,11 +411,14 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::CloseContour pd << aNewObject << " = geompy.CloseContour(" << theObject << ", ["; // list of wire ids - int i = theWires->Lower(), nb = theWires->Upper(); - for ( ; i <= nb; i++) - pd << theWires->Value( i ) << (( i < nb ) ? ", " : "], "); - - pd << (int)isCommonVertex << ")"; + if (!theWires.IsNull()) + { + int i = theWires->Lower(), nb = theWires->Upper(); + pd << theWires->Value(i++); + while (i <= nb) + pd << ", " << theWires->Value(i++); + } + pd << "], " << (int)isCommonVertex << ")"; SetErrorCode(OK); return aNewObject;