osc: notify: fix crash with no message

Closes #1866
This commit is contained in:
Jack Wilsdon 2024-10-28 17:52:09 +00:00 committed by Daniel Eklöf
parent 813b514f63
commit 689549bb1f
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 7 additions and 2 deletions

6
osc.c
View file

@ -557,9 +557,13 @@ osc_notify(struct terminal *term, char *string)
return;
}
char *msgdup = NULL;
if (msg != NULL)
msgdup = xstrdup(msg);
notify_notify(term, &(struct notification){
.title = xstrdup(title),
.body = xstrdup(msg),
.body = msgdup,
.expire_time = -1,
.focus = true,
});