fix for RNA ranges exceeding the range of the type (INT_MAX used on short's for eg).
[blender.git] / source / blender / editors / curve / editcurve.c
index 1679775057cf6ee4a1279686781025f0029037dc..ceb1ace849e5b6a48b1dd1ffa785fbc05b107b57 100644 (file)
@@ -4117,7 +4117,10 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
        invert_m3_m3(imat,mat);
 
        findselectedNurbvert(&editnurb->nurbs, &nu, &bezt, &bp);
-       if(bezt==0 && bp==0) return OPERATOR_CANCELLED;
+
+       if((nu->type==CU_BEZIER && bezt==NULL) || (nu->type!=CU_BEZIER && bp==NULL)) {
+               return OPERATOR_CANCELLED;
+       }
 
        if(nu->type == CU_BEZIER) {
                /* which bezpoint? */