fix for recent commit - would crash adding materials on an object without any.

This commit is contained in:
Campbell Barton
2012-08-14 12:17:06 +00:00
parent 53333c78ce
commit 34ebdcacfc

View File

@@ -808,7 +808,7 @@ void assign_material(Object *ob, Material *ma, short act, int assign_type)
}
// Determine the object/mesh linking
if (assign_type == BKE_MAT_ASSIGN_USERPREF && ob->actcol) {
if (assign_type == BKE_MAT_ASSIGN_USERPREF && ob->totcol && ob->actcol) {
/* copy from previous material */
bit = ob->matbits[ob->actcol - 1];
}