Code Cleanup / Preemptive Bug Fixing: "action" parameter may get set when it shouldn't be

Logically, it makes sense that this parameter only gets used to describe the action
that the F-Curve actually belongs to (if it belongs to one). Otherwise, it should not
be set at all.
This commit is contained in:
Joshua Leung 2014-01-24 16:10:26 +13:00
parent 2b4ff142ab
commit 59b2316e82
1 changed files with 6 additions and 1 deletions

View File

@ -322,6 +322,7 @@ FCurve *rna_get_fcurve_context_ui(bContext *C, PointerRNA *ptr, PropertyRNA *pro
if (animdata) *animdata = NULL;
*r_driven = false;
if (action) *action = NULL;
/* there must be some RNA-pointer + property combon */
if (prop && tptr.id.data && RNA_property_animateable(&tptr, prop)) {
@ -344,8 +345,12 @@ FCurve *rna_get_fcurve_context_ui(bContext *C, PointerRNA *ptr, PropertyRNA *pro
if (path) {
/* animation takes priority over drivers */
if (adt->action && adt->action->curves.first)
if (adt->action && adt->action->curves.first) {
fcu = list_find_fcurve(&adt->action->curves, path, rnaindex);
if (fcu && action)
*action = adt->action;
}
/* if not animated, check if driven */
if (!fcu && (adt->drivers.first)) {