Anim: add type assertion to graph editor function

In `graph_refresh_fcurve_colors()`, add an assertion that the
`bAnimListElem` data is actually an F-Curve before casting it to one.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/123987
This commit is contained in:
Sybren A. Stüvel
2024-07-01 12:41:19 +02:00
committed by Gitea
parent dc2fa02f00
commit bf3dd9a743

View File

@@ -671,6 +671,8 @@ static void graph_refresh_fcurve_colors(const bContext *C)
/* loop over F-Curves, assigning colors */
for (ale = static_cast<bAnimListElem *>(anim_data.first), i = 0; ale; ale = ale->next, i++) {
BLI_assert_msg(ELEM(ale->type, ANIMTYPE_FCURVE, ANIMTYPE_NLACURVE),
"Expecting only FCurves when using the ANIMFILTER_FCURVESONLY filter");
FCurve *fcu = (FCurve *)ale->data;
/* set color of curve here */