From fc6228bd8528629da63cd9b5d012b36e0e5e9fee Mon Sep 17 00:00:00 2001 From: Falk David Date: Mon, 4 Oct 2021 08:14:06 +0200 Subject: Fix T91873: Crash when opening properties panel This patch fixes a crash that was recently introduced by rB5cebcb415e76. The reason were missing poll functions in the UI and operator. Reviewed By: ISS Maniphest Tasks: T91873 Differential Revision: https://developer.blender.org/D12736 --- .../blender/editors/space_sequencer/sequencer_edit.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 9be947b9112..d55356eddec 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -3339,6 +3339,22 @@ static int sequencer_strip_color_tag_set_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } +static bool sequencer_strip_color_tag_set_poll(bContext *C) +{ + Scene *scene = CTX_data_scene(C); + if (scene == NULL) { + return false; + } + + Editing *ed = SEQ_editing_get(scene); + if (ed == NULL) { + return false; + } + + Sequence *act_seq = ed->act_seq; + return act_seq != NULL; +} + void SEQUENCER_OT_strip_color_tag_set(struct wmOperatorType *ot) { /* Identifiers. */ @@ -3348,7 +3364,7 @@ void SEQUENCER_OT_strip_color_tag_set(struct wmOperatorType *ot) /* Api callbacks. */ ot->exec = sequencer_strip_color_tag_set_exec; - ot->poll = sequencer_edit_poll; + ot->poll = sequencer_strip_color_tag_set_poll; /* Flags. */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; -- cgit v1.2.3