diff options
author | Michel Selten <michel@mselten.demon.nl> | 2003-08-27 22:10:59 +0400 |
---|---|---|
committer | Michel Selten <michel@mselten.demon.nl> | 2003-08-27 22:10:59 +0400 |
commit | b64b5d7b63ff852f3fe210fd8200912538f46bd4 (patch) | |
tree | 3b7f5f8a7e3f868c4f99c464a732660ec4bda473 /source | |
parent | dbed08983576dd2059137be3cb21d54cf5728035 (diff) |
* Fix crash when linking something illegal to an Object.
Pointed out and fixed by Stephen Swaney
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/python/api2_2x/Object.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/Object.c b/source/blender/python/api2_2x/Object.c index 8dc0a1d9900..096f4c22803 100644 --- a/source/blender/python/api2_2x/Object.c +++ b/source/blender/python/api2_2x/Object.c @@ -803,6 +803,13 @@ static PyObject *Object_link (BPy_Object *self, PyObject *args) if (NMesh_CheckPyObject (py_data)) data = (void *)NMesh_FromPyObject (py_data); + /* have we set data to something good? */ + if( !data ) + { + return (PythonReturnErrorObject (PyExc_AttributeError, + "link argument type is not supported ")); + } + oldid = (ID*) self->object->data; id = (ID*) data; obj_id = MAKE_ID2 (id->name[0], id->name[1]); |