diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-04-30 23:27:43 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-04-30 23:28:52 +0400 |
commit | 4b759563300633e24f7aa12baa4417e42b8ed018 (patch) | |
tree | c8665ec56804c2d0d4ba7d742fa80d31d0e1da0e | |
parent | 0309a7b9a95a3411ab7fcdab75ffbe67779d9820 (diff) |
Fix T39974: Popups lead to crash if 'UNDO' isn't set
This isn't supported, raise an error instead
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 7b00b704cd1..a4355afbbfc 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1588,6 +1588,14 @@ static int wm_operator_props_popup_ex(bContext *C, wmOperator *op, return OPERATOR_CANCELLED; } + if (do_redo) { + if ((op->type->flag & OPTYPE_UNDO) == 0) { + BKE_reportf(op->reports, RPT_ERROR, + "Operator '%s' does not have undo enabled, incorrect invoke function", op->type->idname); + return OPERATOR_CANCELLED; + } + } + /* if we don't have global undo, we can't do undo push for automatic redo, * so we require manual OK clicking in this popup */ if (!do_redo || !(U.uiflag & USER_GLOBALUNDO)) |