Fix T40776: Crash when using empty curve as a deformation target

This commit is contained in:
Sergey Sharybin 2014-06-25 16:25:43 +06:00
parent da64e8ae05
commit deb3999696

@ -626,16 +626,19 @@ static bool calc_curve_deform(Scene *scene, Object *par, float co[3],
short index;
const bool is_neg_axis = (axis > 2);
/* to be sure, mostly after file load */
if (ELEM(NULL, par->curve_cache, par->curve_cache->path)) {
/* to be sure, mostly after file load, also cyclic dependencies */
#ifdef CYCLIC_DEPENDENCY_WORKAROUND
if (par->curve_cache == NULL) {
BKE_displist_make_curveTypes(scene, par, false);
#endif
if (par->curve_cache->path == NULL) {
return 0; // happens on append and cyclic dependencies...
}
}
#endif
if (par->curve_cache->path == NULL) {
return 0; /* happens on append, cyclic dependencies
* and empty curves
*/
}
/* options */
if (is_neg_axis) {
index = axis - 3;