Now the method checks if the iterator is at the end, and returns None if that is the case.
This commit is contained in:
@@ -115,6 +115,8 @@ PyDoc_STRVAR(AdjacencyIterator_object_doc,
|
||||
|
||||
static PyObject *AdjacencyIterator_object_get(BPy_AdjacencyIterator *self, void *UNUSED(closure))
|
||||
{
|
||||
if (self->a_it->isEnd())
|
||||
Py_RETURN_NONE;
|
||||
ViewEdge *ve = self->a_it->operator*();
|
||||
if (ve)
|
||||
return BPy_ViewEdge_from_ViewEdge(*ve);
|
||||
|
||||
@@ -175,6 +175,8 @@ PyDoc_STRVAR(ChainingIterator_object_doc,
|
||||
|
||||
static PyObject *ChainingIterator_object_get(BPy_ChainingIterator *self, void *UNUSED(closure))
|
||||
{
|
||||
if (self->c_it->isEnd())
|
||||
Py_RETURN_NONE;
|
||||
ViewEdge *ve = self->c_it->operator*();
|
||||
if (ve)
|
||||
return BPy_ViewEdge_from_ViewEdge(*ve);
|
||||
|
||||
@@ -97,6 +97,8 @@ PyDoc_STRVAR(CurvePointIterator_object_doc,
|
||||
|
||||
static PyObject *CurvePointIterator_object_get(BPy_CurvePointIterator *self, void *UNUSED(closure))
|
||||
{
|
||||
if (self->cp_it->isEnd())
|
||||
Py_RETURN_NONE;
|
||||
return BPy_CurvePoint_from_CurvePoint(self->cp_it->operator*());
|
||||
}
|
||||
|
||||
|
||||
@@ -123,6 +123,8 @@ PyDoc_STRVAR(Interface0DIterator_object_doc,
|
||||
|
||||
static PyObject *Interface0DIterator_object_get(BPy_Interface0DIterator *self, void *UNUSED(closure))
|
||||
{
|
||||
if (self->if0D_it->isEnd())
|
||||
Py_RETURN_NONE;
|
||||
return Any_BPy_Interface0D_from_Interface0D(self->if0D_it->operator*());
|
||||
}
|
||||
|
||||
|
||||
@@ -122,6 +122,8 @@ PyDoc_STRVAR(ViewEdgeIterator_object_doc,
|
||||
|
||||
static PyObject *ViewEdgeIterator_object_get(BPy_ViewEdgeIterator *self, void *UNUSED(closure))
|
||||
{
|
||||
if (!self->ve_it->isEnd())
|
||||
Py_RETURN_NONE;
|
||||
ViewEdge *ve = self->ve_it->operator*();
|
||||
if (ve)
|
||||
return BPy_ViewEdge_from_ViewEdge(*ve);
|
||||
|
||||
@@ -103,6 +103,8 @@ PyDoc_STRVAR(orientedViewEdgeIterator_object_doc,
|
||||
|
||||
static PyObject *orientedViewEdgeIterator_object_get(BPy_orientedViewEdgeIterator *self, void *UNUSED(closure))
|
||||
{
|
||||
if (self->ove_it->isEnd())
|
||||
Py_RETURN_NONE;
|
||||
return BPy_directedViewEdge_from_directedViewEdge(self->ove_it->operator*());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user