From c2fab14030773e7295b9b833602a2f4e80353d42 Mon Sep 17 00:00:00 2001 From: Michael Catanzaro Date: Thu, 21 Dec 2023 10:44:25 -0600 Subject: [PATCH] gapplication: ensure app ID is set when sending notification Otherwise, we hit a bunch of criticals later on. Also, document this requirement to ensure there is no ambiguity. Fixes #3203 --- gio/gapplication.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gio/gapplication.c b/gio/gapplication.c index d505c8161..55e7f299c 100644 --- a/gio/gapplication.c +++ b/gio/gapplication.c @@ -2981,6 +2981,9 @@ g_application_get_is_busy (GApplication *application) * If @notification is no longer relevant, it can be withdrawn with * g_application_withdraw_notification(). * + * It is an error to call this function if @application has no + * application ID. + * * Since: 2.40 */ void @@ -2994,6 +2997,7 @@ g_application_send_notification (GApplication *application, g_return_if_fail (G_IS_NOTIFICATION (notification)); g_return_if_fail (g_application_get_is_registered (application)); g_return_if_fail (!g_application_get_is_remote (application)); + g_return_if_fail (g_application_get_application_id (application) != NULL); if (application->priv->notifications == NULL) application->priv->notifications = g_notification_backend_new_default (application);