Salome HOME
Issue #3172: Valid partition is invalid after save/open saved document
[modules/shaper.git] / src / GeomAPI / GeomAPI_Shape.cpp
index 78a10ac3c5ffb0bb6940a29828e1a07dca6c034d..6d5649a75cf3b9bfc367e3e982634ee3ad82b8cd 100644 (file)
@@ -93,11 +93,10 @@ bool GeomAPI_Shape::isEqual(const std::shared_ptr<GeomAPI_Shape> theShape) const
 
 bool GeomAPI_Shape::isSame(const std::shared_ptr<GeomAPI_Shape> theShape) const
 {
-  if (!theShape.get())
-    return false;
+  bool isNullShape = !theShape.get() || theShape->isNull();;
   if (isNull())
-    return theShape->isNull();
-  if (theShape->isNull())
+    return isNullShape;
+  if (isNullShape)
     return false;
 
   return MY_SHAPE->IsSame(theShape->impl<TopoDS_Shape>()) == Standard_True;