From cfc495bb2e87ee09828a25fdb12489dfc01e9928 Mon Sep 17 00:00:00 2001 From: John Kiril Swenson Date: Wed, 9 Jul 2025 08:38:45 +0200 Subject: [PATCH] Fix #141332: Add movie operator crashes Blender PR #141419 gated init behind a `nullptr` check, but it would still try to run transform engine code, which accesses the unset region. Fix by preventing any sort of `move_strips` operation when `region` doesn't exist. Pull Request: https://projects.blender.org/blender/blender/pulls/141582 --- .../blender/editors/space_sequencer/sequencer_add.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/source/blender/editors/space_sequencer/sequencer_add.cc b/source/blender/editors/space_sequencer/sequencer_add.cc index b3a41a9ab0b..71671ffb8fe 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.cc +++ b/source/blender/editors/space_sequencer/sequencer_add.cc @@ -383,7 +383,8 @@ static void restore_move_strips_state(wmOperator *op) static bool load_data_init_from_operator(seq::LoadData *load_data, bContext *C, wmOperator *op) { - Main *bmain = CTX_data_main(C); + const Main *bmain = CTX_data_main(C); + const ARegion *region = CTX_wm_region(C); PropertyRNA *prop; const bool relative = (prop = RNA_struct_find_property(op->ptr, "relative_path")) && @@ -482,9 +483,14 @@ static bool load_data_init_from_operator(seq::LoadData *load_data, bContext *C, } } - const ARegion *region = CTX_wm_region(C); + if (region == nullptr) { + RNA_boolean_set(op->ptr, "move_strips", false); + } + /* Override strip position by current mouse position. */ - if (RNA_boolean_get(op->ptr, "move_strips") && region != nullptr) { + if ((prop = RNA_struct_find_property(op->ptr, "move_strips")) && + RNA_property_boolean_get(op->ptr, prop)) + { const wmWindow *win = CTX_wm_window(C); const float2 mouse_region(win->eventstate->xy[0] - region->winrct.xmin, win->eventstate->xy[1] - region->winrct.ymin);