Fix #23742: a NURBS surface created with two joined curves crashes Blender on rendering

Nurb's material number used to be clamped to [0;-1] for case object hasn't got
materials. Forced to keep material number on zero if object hasn't got any materials.
This commit is contained in:
Sergey Sharybin 2010-09-10 06:05:18 +00:00
parent cf4e32a06c
commit 46f0fbcf0a

@ -5577,7 +5577,9 @@ int join_curve_exec(bContext *C, wmOperator *op)
nu= cu->nurb.first;
while(nu) {
newnu= duplicateNurb(nu);
CLAMP(newnu->mat_nr, 0, ob->totcol-1); /* TODO, merge material lists */
if(ob->totcol) { /* TODO, merge material lists */
CLAMP(newnu->mat_nr, 0, ob->totcol-1);
} else newnu->mat_nr= 0;
BLI_addtail(&tempbase, newnu);
if( (bezt= newnu->bezt) ) {