[Bf-blender-cvs] [4b75956] master: Fix T39974: Popups lead to crash if 'UNDO' isn't set
Campbell Barton
noreply at git.blender.org
Wed Apr 30 21:29:12 CEST 2014
Commit: 4b759563300633e24f7aa12baa4417e42b8ed018
Author: Campbell Barton
Date: Thu May 1 05:27:43 2014 +1000
https://developer.blender.org/rB4b759563300633e24f7aa12baa4417e42b8ed018
Fix T39974: Popups lead to crash if 'UNDO' isn't set
This isn't supported, raise an error instead
===================================================================
M source/blender/windowmanager/intern/wm_operators.c
===================================================================
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 7b00b70..a4355af 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))
More information about the Bf-blender-cvs
mailing list