Joining meshes could crash when 1 had vertexgroups, other not.
The first then should have been appended from other file, to make
it more complex. :)

Crash caused by reading NULL pointer.
This commit is contained in:
Ton Roosendaal
2004-04-27 19:30:16 +00:00
parent 978ba3c208
commit ef4a6c3551

View File

@@ -7160,12 +7160,13 @@ void join_mesh(void)
for (j=0; j<dvert[i].totweight; j++){
// Find the old vertex group
odg = BLI_findlink (&base->object->defbase, dvert[i].dw[j].def_nr);
// Search for a match in the new object
for (dg=ob->defbase.first, index=0; dg; dg=dg->next, index++){
if (!strcmp(dg->name, odg->name)){
dvert[i].dw[j].def_nr = index;
break;
if(odg) {
// Search for a match in the new object
for (dg=ob->defbase.first, index=0; dg; dg=dg->next, index++){
if (!strcmp(dg->name, odg->name)){
dvert[i].dw[j].def_nr = index;
break;
}
}
}
}