summaryrefslogtreecommitdiff
path: root/plugins/Toaster/src/services.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Toaster/src/services.cpp')
-rw-r--r--plugins/Toaster/src/services.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/plugins/Toaster/src/services.cpp b/plugins/Toaster/src/services.cpp
index d930426906..3f701b86f9 100644
--- a/plugins/Toaster/src/services.cpp
+++ b/plugins/Toaster/src/services.cpp
@@ -261,7 +261,16 @@ static INT_PTR ShowMessage(WPARAM wParam, LPARAM lParam)
static INT_PTR HideToast(WPARAM, LPARAM lParam)
{
- static_cast<ToastNotification*>(reinterpret_cast<ToastEventHandler*>(lParam)->GetToastNotification())->Hide();
+ extern LIST<ToastEventHandler> lstHandlers;
+ ToastEventHandler* handler = reinterpret_cast<ToastEventHandler*>(lParam);
+ if (lstHandlers.getIndex(handler) != -1)
+ {
+ ToastNotification* notification = static_cast<ToastNotification*>(handler->GetToastNotification());
+ if (lstNotifications.getIndex(notification) != -1)
+ {
+ notification->Hide();
+ }
+ }
return 0;
}
void __stdcall HideAllToasts(void*)