Part: FaceMaker: check if instance is actually created.
Part::FaceMaker::ConstructFromType() could return null pointer if abstract class type is supplied. Here, it is fixed by checking for null pointer in facemaker itself, rather than in every place ConstructFromType is being used.
This commit is contained in:
@@ -252,13 +252,7 @@ int TopoShapeFacePy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTuple(args, "Os", &pcPyShapeOrList, &className)) {
|
||||
try {
|
||||
std::unique_ptr<FaceMaker> fm_instance = Part::FaceMaker::ConstructFromType(className);
|
||||
FaceMaker* fm = fm_instance.get();
|
||||
if (!fm) {
|
||||
std::stringstream out;
|
||||
out << "Cannot create FaceMaker from abstract type " << className;
|
||||
throw Base::TypeError(out.str());
|
||||
}
|
||||
std::unique_ptr<FaceMaker> fm = Part::FaceMaker::ConstructFromType(className);
|
||||
|
||||
//dump all supplied shapes to facemaker, no matter what type (let facemaker decide).
|
||||
if (PySequence_Check(pcPyShapeOrList)){
|
||||
|
||||
Reference in New Issue
Block a user