If not using sticky mode (the default), clients aren't automagically

assigned a group, thus cc->group will be NULL - fix the client group
shortcut in menu lists; crash reported by Christian Neukirchen.
This commit is contained in:
okan
2013-12-08 13:51:38 +00:00
parent 5dc65d9242
commit 7fad5224d4
2 changed files with 3 additions and 3 deletions

View File

@@ -231,8 +231,8 @@ mousefunc_menu_unhide(struct client_ctx *cc, void *arg)
continue;
mi = xcalloc(1, sizeof(*mi));
(void)snprintf(mi->text, sizeof(mi->text),
"(%d) %s", cc->group->shortcut, wname);
(void)snprintf(mi->text, sizeof(mi->text), "(%d) %s",
cc->group ? cc->group->shortcut : 0, wname);
mi->ctx = cc;
TAILQ_INSERT_TAIL(&menuq, mi, entry);
}