diff --git a/dunst.c b/dunst.c index a5f13f7..c7d7185 100644 --- a/dunst.c +++ b/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); } diff --git a/dunst_dbus.c b/dunst_dbus.c index 1e3ec51..a85e597 100644 --- a/dunst_dbus.c +++ b/dunst_dbus.c @@ -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",