diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/python/bmesh/bmesh_py_types.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c index e6842051e31..ad11ead29a2 100644 --- a/source/blender/python/bmesh/bmesh_py_types.c +++ b/source/blender/python/bmesh/bmesh_py_types.c @@ -1047,6 +1047,8 @@ static PyObject *bpy_bmesh_from_mesh(BPy_BMesh *self, PyObject *args, PyObject * int use_shape_key = false; int shape_key_index = 0; + BPY_BM_CHECK_OBJ(self); + if (!PyArg_ParseTupleAndKeywords(args, kw, "O|iii:from_mesh", (char **)kwlist, &py_mesh, &use_fnorm, &use_shape_key, &shape_key_index) || !(me = PyC_RNA_AsPointer(py_mesh, "Mesh"))) @@ -2918,7 +2920,8 @@ static void bpy_bmvert_dealloc(BPy_BMElem *self) BMesh *bm = self->bm; if (bm) { void **ptr = CustomData_bmesh_get(&bm->vdata, self->ele->head.data, CD_BM_ELEM_PYPTR); - *ptr = NULL; + if (ptr) + *ptr = NULL; } PyObject_DEL(self); } @@ -2928,7 +2931,8 @@ static void bpy_bmedge_dealloc(BPy_BMElem *self) BMesh *bm = self->bm; if (bm) { void **ptr = CustomData_bmesh_get(&bm->edata, self->ele->head.data, CD_BM_ELEM_PYPTR); - *ptr = NULL; + if (ptr) + *ptr = NULL; } PyObject_DEL(self); } @@ -2938,7 +2942,8 @@ static void bpy_bmface_dealloc(BPy_BMElem *self) BMesh *bm = self->bm; if (bm) { void **ptr = CustomData_bmesh_get(&bm->pdata, self->ele->head.data, CD_BM_ELEM_PYPTR); - *ptr = NULL; + if (ptr) + *ptr = NULL; } PyObject_DEL(self); } @@ -2948,7 +2953,8 @@ static void bpy_bmloop_dealloc(BPy_BMElem *self) BMesh *bm = self->bm; if (bm) { void **ptr = CustomData_bmesh_get(&bm->ldata, self->ele->head.data, CD_BM_ELEM_PYPTR); - *ptr = NULL; + if (ptr) + *ptr = NULL; } PyObject_DEL(self); } |