From 17aa5ae7967ae2a9a9c6f6eb57576f62ce94ee6f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 17 Nov 2010 12:52:56 +0000 Subject: [PATCH] bugfix [#24766] Crasher on inserting keyframe on Bezier points [33126] --- source/blender/makesrna/intern/rna_curve.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 598c5a77c82..11037a0b078 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -95,15 +95,17 @@ static Nurb *curve_nurb_from_point(Curve *cu, const void *point, int *nu_index, break; } } - } - - if(nu_index) { - *nu_index= i; } - if(pt_index) { - if(nu->type == CU_BEZIER) *pt_index= (int)((BezTriple *)point - nu->bezt); - else *pt_index= (int)((BPoint *)point - nu->bp); + if(nu) { + if(nu_index) { + *nu_index= i; + } + + if(pt_index) { + if(nu->type == CU_BEZIER) *pt_index= (int)((BezTriple *)point - nu->bezt); + else *pt_index= (int)((BPoint *)point - nu->bp); + } } return nu;