From 0de8610b6715697cc044816358193856115dff40 Mon Sep 17 00:00:00 2001 From: Nikos Tsipinakis Date: Thu, 2 Jul 2020 19:44:26 +0200 Subject: [PATCH] Fix crash when triggering actions via dunstctl g_list_nth_data was used to query the notification list, but in the code it was erroneously assumed that a GList object was returned rather than a notification. One of the many pitfalls of generic pointers... Fixes #727 --- src/dbus.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/dbus.c b/src/dbus.c index eb63f69..ec8e350 100644 --- a/src/dbus.c +++ b/src/dbus.c @@ -224,10 +224,9 @@ static void dbus_cb_dunst_NotificationAction(GDBusConnection *connection, return; } - const GList *list = g_list_nth_data(queues_get_displayed(), notification_nr); + struct notification *n = g_list_nth_data(queues_get_displayed(), notification_nr); - if (list && list->data) { - struct notification *n = list->data; + if (n) { LOG_D("CMD: Calling action for notification %s", n->summary); notification_do_action(n); }