don't segfault on closeNotification with unknown id
This commit is contained in:
parent
ab0404c30d
commit
c85b40e90e
2
dunst.c
2
dunst.c
@ -757,7 +757,7 @@ int close_notification_by_id(int id, int reason)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reason > 0 && reason < 4) {
|
if (reason > 0 && reason < 4 && target != NULL) {
|
||||||
notificationClosed(target, reason);
|
notificationClosed(target, reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -254,7 +254,13 @@ void notificationClosed(notification * n, int reason)
|
|||||||
{
|
{
|
||||||
DBusMessage *dmsg;
|
DBusMessage *dmsg;
|
||||||
DBusMessageIter args;
|
DBusMessageIter args;
|
||||||
int id = n->id;
|
int id;
|
||||||
|
|
||||||
|
if (n == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
id = n->id;
|
||||||
|
|
||||||
dmsg =
|
dmsg =
|
||||||
dbus_message_new_signal("/org/freedesktop/Notifications",
|
dbus_message_new_signal("/org/freedesktop/Notifications",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user