fix for crash showing tooltip for NODE_OT_add_search()

This commit is contained in:
Campbell Barton 2012-08-17 11:31:54 +00:00
parent 219fb7ad79
commit dac761057d
3 changed files with 7 additions and 4 deletions

@ -57,10 +57,10 @@ def node_group_items(tree_type):
def node_type_items_cb(self, context):
snode = context.space_data
if not snode:
return []
return ()
tree = snode.edit_tree
if not tree:
return []
return ()
# Lists of basic node types for each
if not node_type_items_dict:
@ -76,7 +76,7 @@ def node_type_items_cb(self, context):
if tree.type in node_type_items_dict:
return node_type_items_dict[tree.type] + node_group_items(tree.type)
else:
return []
return ()
class NODE_OT_add_search(Operator):

@ -176,7 +176,7 @@ struct uiBut {
struct bContextStore *context;
/* not ysed yet, was used in 2.4x for ui_draw_pulldown_round & friends */
/* not used yet, was used in 2.4x for ui_draw_pulldown_round & friends */
#if 0
void (*embossfunc)(int, int, float, float, float, float, float, int);
void (*sliderfunc)(int, float, float, float, float, float, float, int);

@ -573,6 +573,9 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
char *str;
opptr = uiButGetOperatorPtrRNA(but); /* allocated when needed, the button owns it */
/* so the context is passed to itemf functions (some py itemf functions use it) */
WM_operator_properties_sanitize(opptr, FALSE);
str = WM_operator_pystring(C, but->optype, opptr, 0);
/* operator info */