Fix #127869: Crash when using pick selection in edit mode
The issue was that `retrieve_editable_drawings_grouped_per_frame` returned garbage memory, leading to a crash a bit further. The fix adds a nullptr check to make sure the `current_drawing` exists and can be safely dereferenced.
This commit is contained in:
@@ -745,7 +745,7 @@ Array<Vector<MutableDrawingInfo>> retrieve_editable_drawings_grouped_per_frame(
|
||||
|
||||
/* Add drawing at current frame. */
|
||||
Drawing *current_drawing = grease_pencil.get_drawing_at(layer, current_frame);
|
||||
if (!added_drawings.contains(current_drawing)) {
|
||||
if (current_drawing != nullptr && !added_drawings.contains(current_drawing)) {
|
||||
const int frame_group = selected_frames.index_of(current_frame);
|
||||
drawings_grouped_per_frame[frame_group].append(
|
||||
{*current_drawing, layer_i, current_frame, falloff_per_selected_frame[frame_group]});
|
||||
|
||||
Reference in New Issue
Block a user