Salome HOME
updated copyright message
[modules/shaper.git] / src / GeomAPI / GeomAPI_Lin2d.cpp
index 8194a18d391cbc36bd3927fdeac4ec3672b53689..c74ed5c8b0fe2873f814404c50eb862eb119f3c9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -80,8 +80,8 @@ const std::shared_ptr<GeomAPI_Pnt2d> GeomAPI_Lin2d::intersect(
     const std::shared_ptr<GeomAPI_Lin2d>& theLine) const
 {
   IntAna2d_AnaIntersection anInter(*MY_LIN2D, theLine->impl<gp_Lin2d>());
-  if (!anInter.IsDone() || anInter.IsEmpty())
-  return std::shared_ptr<GeomAPI_Pnt2d>();
+  if (!anInter.IsDone() || anInter.NbPoints() == 0)
+    return std::shared_ptr<GeomAPI_Pnt2d>();
   const gp_Pnt2d& aResult = anInter.Point(1).Value();
   return std::shared_ptr<GeomAPI_Pnt2d>(new GeomAPI_Pnt2d(aResult.X(), aResult.Y()));
 }