Fix Cycles crashing with previous own commit.

Behavior with NULL context was wrong.
This commit is contained in:
Bastien Montagne 2014-10-06 18:00:56 +02:00
parent 8cb1b35bee
commit 29bb5f9a69
1 changed files with 2 additions and 2 deletions

View File

@ -325,10 +325,10 @@ FCurve *rna_get_fcurve_context_ui(bContext *C, PointerRNA *ptr, PropertyRNA *pro
/* there must be some RNA-pointer + property combon */
if (prop && tptr.id.data && RNA_property_animateable(&tptr, prop)) {
AnimData *adt = BKE_animdata_from_id(tptr.id.data);
int step = 2;
int step = C ? 2 : 1; /* Always 1 in case we have no context (can't check in 'ancestors' of given RNA ptr). */
char *path = NULL;
if (adt == NULL) {
if (!adt && C) {
path = BKE_animdata_driver_path_hack(C, &tptr, prop, NULL);
adt = BKE_animdata_from_id(tptr.id.data);
step--;