diff --git a/src/BRepAdaptor/BRepAdaptor_Curve2d.cxx b/src/BRepAdaptor/BRepAdaptor_Curve2d.cxx
index b1a938bc32..2dda607273 100644
--- a/src/BRepAdaptor/BRepAdaptor_Curve2d.cxx
+++ b/src/BRepAdaptor/BRepAdaptor_Curve2d.cxx
@@ -76,7 +76,10 @@ void  BRepAdaptor_Curve2d::Initialize(const TopoDS_Edge& E,
   myFace = F;
   Standard_Real pf,pl;
   const Handle(Geom2d_Curve) PC = BRep_Tool::CurveOnSurface(E,F,pf,pl);
-  Geom2dAdaptor_Curve::Load(PC,pf,pl);
+  if (PC)
+  {
+    Geom2dAdaptor_Curve::Load(PC,pf,pl);
+  }
 }
 
 //=======================================================================
diff --git a/src/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx b/src/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx
index 6c80bf964d..d68e3227f8 100644
--- a/src/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx
+++ b/src/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx
@@ -442,8 +442,10 @@ static Standard_Boolean FindCoordBounds(const TopTools_SequenceOfShape& theFaces
 
   if (aPairSeq.Length() == 2)
     theMinCoord = aPairSeq(2).first - thePeriod;
-  else
+  else if (aPairSeq.Length() > 0)
     theMinCoord = aPairSeq(1).first;
+  else
+    return Standard_False;
 
   theMaxCoord = aPairSeq(1).second;
   return Standard_True;