From ef1bc03fce51e2d79551ae87f2f8c7af8f0c6295 Mon Sep 17 00:00:00 2001 From: Tamito Kajiyama Date: Tue, 12 Nov 2013 02:28:26 +0000 Subject: 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. --- .../blender/freestyle/intern/python/Iterator/BPy_AdjacencyIterator.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/freestyle/intern/python/Iterator/BPy_AdjacencyIterator.cpp') diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_AdjacencyIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_AdjacencyIterator.cpp index 510875ebb2f..0daaa1a0476 100644 --- a/source/blender/freestyle/intern/python/Iterator/BPy_AdjacencyIterator.cpp +++ b/source/blender/freestyle/intern/python/Iterator/BPy_AdjacencyIterator.cpp @@ -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); -- cgit v1.2.3