Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorFalk David <falkdavid@gmx.de>2021-10-04 09:14:06 +0300
committerFalk David <falkdavid@gmx.de>2021-10-04 09:15:03 +0300
commitfc6228bd8528629da63cd9b5d012b36e0e5e9fee (patch)
treec78f395a8d1593dac999104691b9d5a00f07316c /source
parent93e92ac1263505ea3a3bc5a42c1b2f55607ccc45 (diff)
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
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c18
1 files changed, 17 insertions, 1 deletions
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;