Fix [#21949] View center seg fault
authorMatt Ebb <matt@mke3.net>
Fri, 9 Apr 2010 01:44:24 +0000 (01:44 +0000)
committerMatt Ebb <matt@mke3.net>
Fri, 9 Apr 2010 01:44:24 +0000 (01:44 +0000)
Operator needed a better poll function

source/blender/editors/space_image/image_ops.c

index 55e6ac356c66b2b1c08a787b206461b00fa6bf12..f74dc30d567ed80e706fd52d85f6a6270392e92e 100644 (file)
@@ -134,7 +134,6 @@ static int space_image_file_exists_poll(bContext *C)
        return 0;
 }
 
-
 int space_image_main_area_poll(bContext *C)
 {
        SpaceImage *sima= CTX_wm_space_image(C);
@@ -509,6 +508,11 @@ static int view_selected_exec(bContext *C, wmOperator *op)
        return OPERATOR_FINISHED;
 }
 
+static int view_selected_poll(bContext *C)
+{
+       return (space_image_main_area_poll(C) && ED_operator_uvedit(C));
+}
+
 void IMAGE_OT_view_selected(wmOperatorType *ot)
 {
        /* identifiers */
@@ -517,7 +521,7 @@ void IMAGE_OT_view_selected(wmOperatorType *ot)
        
        /* api callbacks */
        ot->exec= view_selected_exec;
-       ot->poll= ED_operator_uvedit;
+       ot->poll= view_selected_poll;
 }
 
 /********************** view zoom in/out operator *********************/