quiet some compiler warnings & fix possible (but unlikely) crash.
[blender.git] / source / blender / editors / curve / editcurve.c
index 06d88b16fa8e3508144e5a5a73b64dd787e65cc1..8b9477adf926d556768a8e2c8b0ea18eee4ff706 100644 (file)
@@ -6544,12 +6544,15 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
                BLI_assert(!"invalid nurbs type");
                return NULL;
        }
-       
-       /* always do: */
-       nu->flag |= CU_SMOOTH;
-       
-       test2DNurb(nu);
-       
+
+       BLI_assert(nu != NULL);
+
+       if(nu) { /* should always be set */
+               nu->flag |= CU_SMOOTH;
+
+               test2DNurb(nu);
+       }
+
        return nu;
 }