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,8 +17,11 @@ 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");
notify_notification_show(pNotif, NULL); if(pNotif)
g_object_unref(G_OBJECT(pNotif)); {
notify_notification_show(pNotif, NULL);
g_object_unref(G_OBJECT(pNotif));
}
} }
#else #else
void NotificationsInit() void NotificationsInit()