Bug #1459
authorTon Roosendaal <ton@blender.org>
Wed, 21 Jul 2004 17:44:44 +0000 (17:44 +0000)
committerTon Roosendaal <ton@blender.org>
Wed, 21 Jul 2004 17:44:44 +0000 (17:44 +0000)
New buttons in editmode for mball forgot to check on NULL pointer.

source/blender/src/drawview.c
source/blender/src/editobject.c

index f5a915f171e35a557f28fb869243966388b829a9..8367fdcc582111b74c39d389188497518482790b 100644 (file)
@@ -1293,24 +1293,26 @@ static void v3d_editarmature_buts(uiBlock *block, Object *ob, float lim)
 
 static void v3d_editmetaball_buts(uiBlock *block, Object *ob, float lim)
 {
-        extern MetaElem *lastelem;
-                                                                                                                             
-        uiBlockBeginAlign(block);
-        uiDefButF(block, NUM, B_RECALCMBALL, "LocX:", 10, 70, 140, 19, &lastelem->x, -lim, lim, 100, 3, "");
-        uiDefButF(block, NUM, B_RECALCMBALL, "LocY:", 10, 50, 140, 19, &lastelem->y, -lim, lim, 100, 3, "");
-        uiDefButF(block, NUM, B_RECALCMBALL, "LocZ:", 10, 30, 140, 19, &lastelem->z, -lim, lim, 100, 3, "");
-                                                                                                                             
-        uiBlockBeginAlign(block);
-        if(lastelem->type!=MB_BALL)
-        uiDefButF(block, NUM, B_RECALCMBALL, "dx:", 160, 70, 140, 19, &lastelem->expx, 0, lim, 100, 3, "");
-        if((lastelem->type!=MB_BALL) && (lastelem->type!=MB_TUBE))
-        uiDefButF(block, NUM, B_RECALCMBALL, "dy:", 160, 50, 140, 19, &lastelem->expy, 0, lim, 100, 3, "");
-        if((lastelem->type==MB_ELIPSOID) || (lastelem->type==MB_CUBE))
-        uiDefButF(block, NUM, B_RECALCMBALL, "dz:", 160, 30, 140, 19, &lastelem->expz, 0, lim, 100, 3, "");
-                                                                                                                             
-        uiBlockEndAlign(block);
-                                                                                                                             
-        uiDefButF(block, NUM, B_RECALCMBALL, "Stiffness:", 10, 100, 140, 19, &lastelem->s, 0, lim, 100, 3, "");
+       extern MetaElem *lastelem;
+                                                                                                                                                                                                                                                       
+       if(lastelem) {
+               uiBlockBeginAlign(block);
+               uiDefButF(block, NUM, B_RECALCMBALL, "LocX:", 10, 70, 140, 19, &lastelem->x, -lim, lim, 100, 3, "");
+               uiDefButF(block, NUM, B_RECALCMBALL, "LocY:", 10, 50, 140, 19, &lastelem->y, -lim, lim, 100, 3, "");
+               uiDefButF(block, NUM, B_RECALCMBALL, "LocZ:", 10, 30, 140, 19, &lastelem->z, -lim, lim, 100, 3, "");
+                                                                                                                                                                                                                                                               
+               uiBlockBeginAlign(block);
+               if(lastelem->type!=MB_BALL)
+               uiDefButF(block, NUM, B_RECALCMBALL, "dx:", 160, 70, 140, 19, &lastelem->expx, 0, lim, 100, 3, "");
+               if((lastelem->type!=MB_BALL) && (lastelem->type!=MB_TUBE))
+               uiDefButF(block, NUM, B_RECALCMBALL, "dy:", 160, 50, 140, 19, &lastelem->expy, 0, lim, 100, 3, "");
+               if((lastelem->type==MB_ELIPSOID) || (lastelem->type==MB_CUBE))
+               uiDefButF(block, NUM, B_RECALCMBALL, "dz:", 160, 30, 140, 19, &lastelem->expz, 0, lim, 100, 3, "");
+                                                                                                                                                                                                                                                               
+               uiBlockEndAlign(block);
+                                                                                                                                                                                                                                                               
+               uiDefButF(block, NUM, B_RECALCMBALL, "Stiffness:", 10, 100, 140, 19, &lastelem->s, 0, lim, 100, 3, "");
+       }
 }
 
 void do_viewbuts(unsigned short event)
index 41f8ae538c4dcb7d361428401883c43f658c72b2..209258326e54d4ccda528b6ee0e979482e00ccf4 100644 (file)
 #include "BLI_editVert.h"
 #include "BLI_ghash.h"
 
-#include "BKE_nla.h"
 #include "BKE_utildefines.h"
 #include "BKE_anim.h"
 #include "BKE_blender.h"
+#include "BKE_booleanops.h"
 #include "BKE_curve.h"
 #include "BKE_displist.h"
 #include "BKE_effect.h"
 #include "BKE_material.h"
 #include "BKE_mball.h"
 #include "BKE_mesh.h"
+#include "BKE_nla.h"
 #include "BKE_object.h"
 #include "BKE_property.h"
 #include "BKE_sca.h"
 #include "BKE_scene.h"
 #include "BKE_subsurf.h"
 #include "BKE_texture.h"
-#include "BKE_booleanops.h"
 
 #include "BIF_gl.h"
 #include "BIF_graphics.h"