check if display exists before dereferencing it

Bug: 43054
Bug: 51500

Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
This commit is contained in:
Amadeusz Sławiński
2017-07-24 17:09:48 +02:00
parent c8e8793b17
commit a5d0841f85

View File

@@ -4515,7 +4515,7 @@ char *AddWindowFlags(char *buf, int len, Window *p)
*s++ = '-';
if (p->w_layer.l_cvlist && p->w_layer.l_cvlist->c_lnext)
*s++ = '&';
if (p->w_monitor == MON_DONE && (ACLBYTE(p->w_mon_notify, D_user->u_id) & ACLBIT(D_user->u_id))
if (display && p->w_monitor == MON_DONE && (ACLBYTE(p->w_mon_notify, D_user->u_id) & ACLBIT(D_user->u_id))
)
*s++ = '@';
if (p->w_bell == BELL_DONE)