diff --git a/src/App/PropertyLinks.cpp b/src/App/PropertyLinks.cpp index 88652a7c2..5e00cdbb3 100644 --- a/src/App/PropertyLinks.cpp +++ b/src/App/PropertyLinks.cpp @@ -249,7 +249,9 @@ void PropertyLinkSub::setPyObject(PyObject *value) } else if (PyTuple_Check(value) || PyList_Check(value)) { Py::Sequence seq(value); - if (PyObject_TypeCheck(seq[0].ptr(), &(DocumentObjectPy::Type))){ + if(seq.size() == 0) + setValue(NULL); + else if (PyObject_TypeCheck(seq[0].ptr(), &(DocumentObjectPy::Type))){ DocumentObjectPy *pcObj = (DocumentObjectPy*)seq[0].ptr(); if (seq[1].isString()) { std::vector vals; diff --git a/src/Mod/PartDesign/TestPartDesignApp.py b/src/Mod/PartDesign/TestPartDesignApp.py index ec97a09fd..d90c2cd92 100644 --- a/src/Mod/PartDesign/TestPartDesignApp.py +++ b/src/Mod/PartDesign/TestPartDesignApp.py @@ -36,7 +36,7 @@ class PartDesignPadTestCases(unittest.TestCase): TestSketcherApp.CreateSlotPlateSet(self.PadSketch) self.Doc.recompute() self.Pad = self.Doc.addObject("PartDesign::Pad","Pad") - self.Pad.Sketch = self.PadSketch + self.Pad.Profile = self.PadSketch self.Doc.recompute() self.failUnless(len(self.Pad.Shape.Faces) == 6)