Fix: Crash when trying to get FCurve segments of baked curve

When using the slider operators in the Graph Editor
the code would try to access `FCurve.bezt` without checking that exists.
When the curve is baked that is a null pointer.

Pull Request: https://projects.blender.org/blender/blender/pulls/106102
This commit is contained in:
Christoph Lendenfeld
2023-03-24 13:52:54 +01:00
committed by Christoph Lendenfeld
parent 22a3eb47ec
commit d78550634a

View File

@@ -279,6 +279,12 @@ static bool find_fcurve_segment(FCurve *fcu,
ListBase find_fcurve_segments(FCurve *fcu)
{
ListBase segments = {NULL, NULL};
/* Ignore baked curves. */
if (!fcu->bezt) {
return segments;
}
int segment_start_idx = 0;
int segment_len = 0;
int current_index = 0;