don't segfault on closeNotification with unknown id

This commit is contained in:
Sascha Kruse 2012-07-17 00:31:57 +02:00
parent ab0404c30d
commit c85b40e90e
2 changed files with 8 additions and 2 deletions

View File

@ -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);
}

View File

@ -254,7 +254,13 @@ void notificationClosed(notification * n, int reason)
{
DBusMessage *dmsg;
DBusMessageIter args;
int id = n->id;
int id;
if (n == NULL) {
return;
}
id = n->id;
dmsg =
dbus_message_new_signal("/org/freedesktop/Notifications",