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:
authorCampbell Barton <ideasman42@gmail.com>2007-05-28 20:49:48 +0400
committerCampbell Barton <ideasman42@gmail.com>2007-05-28 20:49:48 +0400
commita8bc1f33974ca4a32b597cb1e0a63b8b3c5cb641 (patch)
tree7ab49b4dcf9bd3dc2d89f634ae0ae44d775e87ea /source/blender/python/api2_2x/Mesh.c
parent3030e93a5ba941cefde52c604d52afd4965aad6b (diff)
fix for a crash in Blender.Mesh,
getting curve data from an object failed (with only 1 curve vertex) Blender.Mesh didnt check this and crashed.
Diffstat (limited to 'source/blender/python/api2_2x/Mesh.c')
-rw-r--r--source/blender/python/api2_2x/Mesh.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/Mesh.c b/source/blender/python/api2_2x/Mesh.c
index 30b67426e6a..b64259553bf 100644
--- a/source/blender/python/api2_2x/Mesh.c
+++ b/source/blender/python/api2_2x/Mesh.c
@@ -5704,6 +5704,10 @@ static PyObject *Mesh_getFromObject( BPy_Mesh * self, PyObject * args )
nurbs_to_mesh( tmpobj );
tmpmesh = tmpobj->data;
free_libblock_us( &G.main->object, tmpobj );
+
+ if (ob->type != OB_MESH)
+ return EXPP_ReturnPyObjError( PyExc_RuntimeError,
+ "cant convert curve to mesh. Does the curve have any segments?" );
break;
case OB_MBALL:
/* metaballs don't have modifiers, so just convert to mesh */