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.
This commit is contained in:
Marco Trevisan (Treviño) 2022-05-17 04:09:56 +02:00
parent 13718b6ea0
commit adb3e0c7bf
1 changed files with 2 additions and 4 deletions

View File

@ -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