Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Oeser <info@graphics-engineer.com>2019-11-07 19:53:05 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2019-11-08 16:34:25 +0300
commit3b66d2ed21a35036f8221d831f96556f85261db9 (patch)
tree345807ac73bcd52cba04d41899da02774bdcbea1
parente8cd2269b40ddd21a10fd1f745ebc131c74ca9a8 (diff)
Fix T71405: Trying to Ctrl-C on many buttons crashes Blender
Usually Ctrl+C copies the operator name to the clipboard ["bpy.ops.material.new()", "bpy.ops.object.material_slot_remove()"] Crash happens for all buttons of UI_BTYPE_BUT without associated operator [some are defined with callbacks only, often these are created with e.g uiDefIconBut (instead of e.g. uiDefIconButO)] Other examples that crash with Ctrl+C: - animation decorators next to animatable properties - button to show a modifier texture in the texture tab - ... 2.79 survived here (result in the clipboard was just not changed hitting Ctrl+C on these buttons), this is what happens with this patch as well. Maniphest Tasks: T71405 Differential Revision: https://developer.blender.org/D6208
-rw-r--r--source/blender/editors/interface/interface_handlers.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 2d739899ae8..0b4adb33b1c 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -2528,6 +2528,9 @@ static void ui_but_copy(bContext *C, uiBut *but, const bool copy_array)
break;
case UI_BTYPE_BUT:
+ if (!but->optype) {
+ break;
+ }
ui_but_copy_operator(C, but, buf, buf_max_len);
is_buf_set = true;
break;