From adb3e0c7bf10f82541521d9ab617e42a44128c91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Tue, 17 May 2022 04:09:56 +0200 Subject: [PATCH] notification: Warn if trying to get the activation token outside activation This API is intended to be used only during a NotifyActionCallback, so ensure that this is the case, by warn in case it's not the case. --- libnotify/notification.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libnotify/notification.c b/libnotify/notification.c index de563d2..c8c7010 100644 --- a/libnotify/notification.c +++ b/libnotify/notification.c @@ -1694,11 +1694,9 @@ const char * notify_notification_get_activation_token (NotifyNotification *notification) { g_return_val_if_fail (NOTIFY_IS_NOTIFICATION (notification), NULL); + g_return_val_if_fail (notification->priv->activating, NULL); - if (notification->priv->activating) - return notification->priv->activation_token; - - return NULL; + return notification->priv->activation_token; } gboolean