Make sure notification object exists

This commit is contained in:
Dennis Felsing 2023-10-08 14:01:02 +02:00
parent f7d23844db
commit 1f5a764cf5

View file

@ -17,9 +17,12 @@ void NotificationsUninit()
void NotificationsNotify(const char *pTitle, const char *pMessage) void NotificationsNotify(const char *pTitle, const char *pMessage)
{ {
NotifyNotification *pNotif = notify_notification_new(pTitle, pMessage, "ddnet"); NotifyNotification *pNotif = notify_notification_new(pTitle, pMessage, "ddnet");
if(pNotif)
{
notify_notification_show(pNotif, NULL); notify_notification_show(pNotif, NULL);
g_object_unref(G_OBJECT(pNotif)); g_object_unref(G_OBJECT(pNotif));
} }
}
#else #else
void NotificationsInit() void NotificationsInit()
{ {