summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2022-05-17 04:09:56 +0200
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2022-06-07 03:18:38 +0200
commitadb3e0c7bf10f82541521d9ab617e42a44128c91 (patch)
tree06fddceca30e580f1e08d2dd3e29b09b502b81ea
parent13718b6ea0284ccb5561b1465499fa5fff572ddd (diff)
downloadlibnotify-adb3e0c7bf10f82541521d9ab617e42a44128c91.tar.gz
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.
-rw-r--r--libnotify/notification.c6
1 files 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