0027104: DownCast() cannot return null for mismatched handle
[occt.git] / src / ChFi2d / ChFi2d_Builder_0.cxx
index a3d0c6e..657ba0c 100644 (file)
@@ -777,9 +777,9 @@ Standard_Boolean IsLineOrCircle(const TopoDS_Edge& E,
   Handle(Geom2d_Curve) basisC; 
   Handle(Geom2d_TrimmedCurve) TC = Handle(Geom2d_TrimmedCurve)::DownCast(C);
   if (!TC.IsNull())
-    basisC = Handle(Geom2d_Curve)::DownCast(TC->BasisCurve());
+    basisC = TC->BasisCurve();
   else
-    basisC = Handle(Geom2d_Curve)::DownCast(C);
+    basisC = C;
 
   if ( basisC->DynamicType() == STANDARD_TYPE(Geom2d_Circle)
       || basisC->DynamicType() == STANDARD_TYPE(Geom2d_Line) ) {