mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
Utils: Check system tray exists before trying to use it
Fixes https://github.com/obsproject/obs-studio/issues/9991
This commit is contained in:
parent
f48fcc06ec
commit
0189c3a3f5
@ -116,11 +116,12 @@ void Utils::Platform::SendTrayNotification(QSystemTrayIcon::MessageIcon icon, QS
|
|||||||
obs_queue_task(
|
obs_queue_task(
|
||||||
OBS_TASK_UI,
|
OBS_TASK_UI,
|
||||||
[](void *param) {
|
[](void *param) {
|
||||||
void *systemTrayPtr = obs_frontend_get_system_tray();
|
|
||||||
auto systemTray = static_cast<QSystemTrayIcon *>(systemTrayPtr);
|
|
||||||
|
|
||||||
auto notification = static_cast<SystemTrayNotification *>(param);
|
auto notification = static_cast<SystemTrayNotification *>(param);
|
||||||
systemTray->showMessage(notification->title, notification->body, notification->icon);
|
void *systemTrayPtr = obs_frontend_get_system_tray();
|
||||||
|
if (systemTrayPtr) {
|
||||||
|
auto systemTray = static_cast<QSystemTrayIcon *>(systemTrayPtr);
|
||||||
|
systemTray->showMessage(notification->title, notification->body, notification->icon);
|
||||||
|
}
|
||||||
delete notification;
|
delete notification;
|
||||||
},
|
},
|
||||||
(void *)notification, false);
|
(void *)notification, false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user