From 90fbab33f86763c02b1be4f48cb610faccffed27 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Sat, 9 Mar 2013 10:52:43 +0000 Subject: [PATCH] Fix #34574: Empty Movie Clip Editor crash on select --- .../blender/editors/space_clip/tracking_select.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/space_clip/tracking_select.c b/source/blender/editors/space_clip/tracking_select.c index bec50130230..d320d41dcd1 100644 --- a/source/blender/editors/space_clip/tracking_select.c +++ b/source/blender/editors/space_clip/tracking_select.c @@ -268,6 +268,17 @@ static int mouse_select(bContext *C, float co[2], int extend) return OPERATOR_FINISHED; } +static int select_poll(bContext *C) +{ + SpaceClip *sc = CTX_wm_space_clip(C); + + if (sc) { + return sc->clip && sc->view == SC_VIEW_CLIP; + } + + return FALSE; +} + static int select_exec(bContext *C, wmOperator *op) { float co[2]; @@ -317,8 +328,7 @@ void CLIP_OT_select(wmOperatorType *ot) /* api callbacks */ ot->exec = select_exec; ot->invoke = select_invoke; - //ot->poll = ED_space_clip_tracking_poll; // so mask view can Ctrl+RMB markers - ot->poll = ED_space_clip_view_clip_poll; + ot->poll = select_poll; /* flags */ ot->flag = OPTYPE_UNDO;