Commit ea07200f5b404175ec25bea72e1f551ecae3bf9f
1 parent
ae57e6cf
Exists in
master
and in
4 other branches
Fixing crash on actions without label.
Showing
2 changed files
with
8 additions
and
4 deletions
Show diff stats
src/objects/actions/button.c
... | ... | @@ -69,9 +69,10 @@ |
69 | 69 | |
70 | 70 | g_autofree gchar * tooltip = g_action_get_tooltip(action); |
71 | 71 | g_autofree gchar * label = g_action_get_label(action); |
72 | -// debug("%s(%s).label=%s",__FUNCTION__,g_action_get_name(action),label); | |
73 | - if(!label) | |
74 | - return NULL; | |
72 | + if(!label) { | |
73 | + g_warning("Can't get label for action \"%s\"", g_action_get_name(action)); | |
74 | + label = g_strdup(g_action_get_name(action)); | |
75 | + } | |
75 | 76 | |
76 | 77 | g_autofree gchar * icon_name = g_action_get_icon_name(action); |
77 | 78 | // debug("%s(%s).icon_name=%s",__FUNCTION__,g_action_get_name(action),icon_name); | ... | ... |
src/objects/toolbar/actions.c
... | ... | @@ -66,8 +66,11 @@ |
66 | 66 | if(!action) { |
67 | 67 | const gchar *ptr = strchr(name,'.'); |
68 | 68 | |
69 | - if(ptr) | |
69 | + if(ptr) { | |
70 | 70 | action = g_action_map_lookup_action(G_ACTION_MAP(window), ptr+1); |
71 | + debug("action(%s)=%p",ptr+1,action); | |
72 | + } | |
73 | + | |
71 | 74 | } |
72 | 75 | |
73 | 76 | debug("%s(%s)=%p",__FUNCTION__,name,action); | ... | ... |