diff options
Diffstat (limited to 'source/blender/freestyle/intern/python')
-rw-r--r-- | source/blender/freestyle/intern/python/BPy_Iterator.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/freestyle/intern/python/BPy_Iterator.cpp b/source/blender/freestyle/intern/python/BPy_Iterator.cpp index 3356325c92f..1ae58073a67 100644 --- a/source/blender/freestyle/intern/python/BPy_Iterator.cpp +++ b/source/blender/freestyle/intern/python/BPy_Iterator.cpp @@ -209,12 +209,20 @@ PyObject * Iterator_getExactTypeName(BPy_Iterator* self) { PyObject * Iterator_increment(BPy_Iterator* self) { + if (self->it->isEnd()) { + PyErr_SetString(PyExc_RuntimeError , "cannot increment any more"); + return NULL; + } self->it->increment(); Py_RETURN_NONE; } PyObject * Iterator_decrement(BPy_Iterator* self) { + if (self->it->isBegin()) { + PyErr_SetString(PyExc_RuntimeError , "cannot decrement any more"); + return NULL; + } self->it->decrement(); Py_RETURN_NONE; |