Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2013-11-12 06:28:26 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2013-11-12 06:28:26 +0400
commitef1bc03fce51e2d79551ae87f2f8c7af8f0c6295 (patch)
tree3aebe75f81c63213b9dc6be4f8b2d52c7a46bcb3 /source/blender/freestyle/intern/python/Iterator/BPy_Interface0DIterator.cpp
parent59e46005261ea2739fe3d3009ac7cc43fdfa6833 (diff)
Fix #37092 and #37381: crashes in the .object() method of Freestyle iterators.
Now the method checks if the iterator is at the end, and returns None if that is the case.
Diffstat (limited to 'source/blender/freestyle/intern/python/Iterator/BPy_Interface0DIterator.cpp')
-rw-r--r--source/blender/freestyle/intern/python/Iterator/BPy_Interface0DIterator.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_Interface0DIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_Interface0DIterator.cpp
index 3a537eb672a..2f6c8ff7348 100644
--- a/source/blender/freestyle/intern/python/Iterator/BPy_Interface0DIterator.cpp
+++ b/source/blender/freestyle/intern/python/Iterator/BPy_Interface0DIterator.cpp
@@ -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*());
}