diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-09-04 12:49:11 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-09-04 12:49:11 +0400 |
commit | 6ed49857a4408bf413f4bf626229aa00d6c8cad7 (patch) | |
tree | fe28f1a9577172536f7ef33bfbaf0e84bf55ef1c /source/blender/editors/space_console | |
parent | 15ef88b90239af30b08e798cc57cea317f1d56c9 (diff) |
poll functions to stop crashing when running operators in an invalid context.
Diffstat (limited to 'source/blender/editors/space_console')
-rw-r--r-- | source/blender/editors/space_console/console_ops.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c index f8dbe0c3dd4..3d0d284b501 100644 --- a/source/blender/editors/space_console/console_ops.c +++ b/source/blender/editors/space_console/console_ops.c @@ -234,6 +234,11 @@ static int console_edit_poll(bContext *C) return 1; } +static int console_poll(bContext *C) +{ + return (CTX_wm_space_console(C) != NULL); +} + /* static funcs for text editing */ @@ -695,6 +700,7 @@ void CONSOLE_OT_zoom(wmOperatorType *ot) /* api callbacks */ ot->exec= zoom_exec; + ot->poll= console_poll; /* flags */ /* ot->flag= OPTYPE_REGISTER; */ /* super annoying */ |