handle possible crashes with FaceMaker and fix a few coding flaws
This commit is contained in:
@@ -81,8 +81,12 @@ App::DocumentObjectExecReturn *Face::execute(void)
|
||||
if (links.empty())
|
||||
return new App::DocumentObjectExecReturn("No shapes linked");
|
||||
|
||||
std::unique_ptr<FaceMaker> fm_instance = FaceMaker::ConstructFromType(this->FaceMakerClass.getValue());
|
||||
FaceMaker* facemaker = &(*(fm_instance));
|
||||
std::unique_ptr<FaceMaker> facemaker = FaceMaker::ConstructFromType(this->FaceMakerClass.getValue());
|
||||
if (!facemaker) {
|
||||
std::stringstream out;
|
||||
out << "Cannot create FaceMaker from abstract type " << this->FaceMakerClass.getValue();
|
||||
throw Base::TypeError(out.str());
|
||||
}
|
||||
|
||||
for (std::vector<App::DocumentObject*>::iterator it = links.begin(); it != links.end(); ++it) {
|
||||
if (!(*it && (*it)->isDerivedFrom(Part::Feature::getClassTypeId())))
|
||||
|
||||
Reference in New Issue
Block a user