X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomValidators%2FGeomValidators_ZeroOffset.cpp;h=20d324edd59db1d70acaf4c152607a02cf6b75fd;hb=53b5b11e96fa0bb95c007e7022c83ad08119d163;hp=1ba9664d992f2a58501d8cf8bb0d41056daa0e62;hpb=b8c11eeb8598fb6c6b185770d44cb48379f25fde;p=modules%2Fshaper.git diff --git a/src/GeomValidators/GeomValidators_ZeroOffset.cpp b/src/GeomValidators/GeomValidators_ZeroOffset.cpp index 1ba9664d9..20d324edd 100644 --- a/src/GeomValidators/GeomValidators_ZeroOffset.cpp +++ b/src/GeomValidators/GeomValidators_ZeroOffset.cpp @@ -6,6 +6,8 @@ #include +#include + #include #include #include @@ -21,7 +23,7 @@ //================================================================================================= bool GeomValidators_ZeroOffset::isValid(const std::shared_ptr& theFeature, const std::list& theArguments, - std::string& theError) const + Events_InfoMessage& theError) const { if(theArguments.size() != 9) { theError = "Wrong number of validator arguments in xml(expected 9)."; @@ -140,9 +142,17 @@ bool GeomValidators_ZeroOffset::isValid(const std::shared_ptr& isPlanesCoincident = true; } else if(aFromShape.get() && aToShape.get()) { std::shared_ptr aFromFace(new GeomAPI_Face(aFromShape)); + if (aFromFace->isNull()) { + theError = "From face selection is invalid."; + return false; + } std::shared_ptr aFromPln = aFromFace->getPlane(); std::shared_ptr aToFace(new GeomAPI_Face(aToShape)); + if (aToFace->isNull()) { + theError = "To face selection is invalid."; + return false; + } std::shared_ptr aToPln = aToFace->getPlane(); if(aFromPln.get()) { @@ -152,8 +162,16 @@ bool GeomValidators_ZeroOffset::isValid(const std::shared_ptr& std::shared_ptr aFace; if(aFromShape.get()) { aFace.reset(new GeomAPI_Face(aFromShape)); + if (aFace->isNull()) { + theError = "From face selection is invalid."; + return false; + } } else { aFace.reset(new GeomAPI_Face(aToShape)); + if (aFace->isNull()) { + theError = "To face selection is invalid."; + return false; + } } std::shared_ptr aPln = aFace->getPlane(); if(aPln.get()) {