fix for missing NULL check in bmesh.from_mesh(), bug [#30446]

This commit is contained in:
2012-03-04 11:10:11 +00:00
parent dceab32f78
commit 34db81a6dc

View File

@@ -60,14 +60,19 @@ static PyObject *bpy_bm_from_mesh(PyObject *UNUSED(self), PyObject *value)
{
Mesh *me = PyC_RNA_AsPointer(value, "Mesh");
/* temp! */
if (!me->edit_btmesh) {
PyErr_SetString(PyExc_ValueError,
"Mesh is not in editmode");
if (me) {
/* temp! */
if (!me->edit_btmesh) {
PyErr_SetString(PyExc_ValueError,
"Mesh is not in editmode");
return NULL;
}
return BPy_BMesh_CreatePyObject(me->edit_btmesh->bm);
}
else {
return NULL;
}
return BPy_BMesh_CreatePyObject(me->edit_btmesh->bm);
}
static struct PyMethodDef BPy_BM_methods[] = {