Fix #141332: Add movie operator crashes Blender

Caused by null dereference, because operator was executed with
overridden context with region not set.

Pull Request: https://projects.blender.org/blender/blender/pulls/141419
This commit is contained in:
Richard Antalik
2025-07-05 01:34:30 +02:00
committed by Richard Antalik
parent 0ceedc2a7d
commit 4d65362550

View File

@@ -482,11 +482,10 @@ static bool load_data_init_from_operator(seq::LoadData *load_data, bContext *C,
}
}
const ARegion *region = CTX_wm_region(C);
/* Override strip position by current mouse position. */
if (RNA_boolean_get(op->ptr, "move_strips")) {
if (RNA_boolean_get(op->ptr, "move_strips") && region != nullptr) {
const wmWindow *win = CTX_wm_window(C);
const ARegion *region = CTX_wm_region(C);
const float2 mouse_region(win->eventstate->xy[0] - region->winrct.xmin,
win->eventstate->xy[1] - region->winrct.ymin);
float2 mouse_view;