same as 2.44 stable - missing NULL checks.
authorCampbell Barton <ideasman42@gmail.com>
Fri, 29 Jun 2007 13:46:15 +0000 (13:46 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 29 Jun 2007 13:46:15 +0000 (13:46 +0000)
source/blender/python/api2_2x/Mesh.c
source/blender/src/editdeform.c

index 164fdb4b372c451a99ce22536af45d763954f823..3e5ffa22eaf8345178f61639058edec7d2f8b52f 100644 (file)
@@ -2542,6 +2542,9 @@ static PyObject *MEdge_getLength( BPy_MEdge * self )
 static PyObject *MEdge_getKey( BPy_MEdge * self )
 {
        MEdge *edge = MEdge_get_pointer( self );
+       if (!edge)
+               return NULL; /* error is set */ 
+       
        PyObject *attr = PyTuple_New( 2 );
        if (edge->v1 > edge->v2) {
                PyTuple_SET_ITEM( attr, 0, PyInt_FromLong(edge->v2) );
index 7a086ed5be3629d132b55215c4adf5024be0dace..6d0c34f2bf8e2d80465ba18d5b4d57cdb8666300 100644 (file)
@@ -334,11 +334,13 @@ void del_defgroup (Object *ob)
                MDeformVert *dvert= editLatt->dvert;
                int a, tot;
                
-               tot= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw;
-               for(a=0, bp= editLatt->def; a<tot; a++, bp++, dvert++) {
-                       for (i=0; i<dvert->totweight; i++){
-                               if (dvert->dw[i].def_nr > (ob->actdef-1))
-                                       dvert->dw[i].def_nr--;
+               if (dvert) {
+                       tot= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw;
+                       for(a=0, bp= editLatt->def; a<tot; a++, bp++, dvert++) {
+                               for (i=0; i<dvert->totweight; i++){
+                                       if (dvert->dw[i].def_nr > (ob->actdef-1))
+                                               dvert->dw[i].def_nr--;
+                               }
                        }
                }
        }