Orange 'layer commit' fix: Texture buttons crash when selecting an empty
authorTon Roosendaal <ton@blender.org>
Sun, 4 Dec 2005 16:15:04 +0000 (16:15 +0000)
committerTon Roosendaal <ton@blender.org>
Sun, 4 Dec 2005 16:15:04 +0000 (16:15 +0000)
texture channel

source/blender/src/buttons_shading.c

index c37544e911a88860e3e0cec3a32a6f4aa9878044..ca911ee2e79cf24e51b76b1327db61db91c7ad20 100644 (file)
@@ -1416,7 +1416,7 @@ static void texture_panel_texture(MTex *mtex, Material *ma, World *wrld, Lamp *l
 {
        MTex *mt=NULL;
        uiBlock *block;
-       ID *id, *idfrom;
+       ID *id=NULL, *idfrom;
        int a, yco, loos;
        char str[32];
        
@@ -1425,7 +1425,9 @@ static void texture_panel_texture(MTex *mtex, Material *ma, World *wrld, Lamp *l
        if(uiNewPanel(curarea, block, "Texture", "Texture", 320, 0, 318, 204)==0) return;
 
        /* first do the browse but */
-       id= (ID *)mtex->tex;
+       if(mtex)
+               id= (ID *)mtex->tex;
+       
        if(ma) idfrom= &ma->id;
        else if(wrld) idfrom= &wrld->id;
        else idfrom= &la->id;