From ac0997bfcff6d17fca44377bbeea0aaa117eb37b Mon Sep 17 00:00:00 2001
From: Ilya Fedin <fedin-ilja2010@ya.ru>
Date: Thu, 24 Apr 2025 06:54:46 +0000
Subject: [PATCH] Fix a crash on Linux without actions notification capability

---
 .../platform/linux/notifications_manager_linux.cpp   | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp
index 45cb6a38753900..d49fecb8148a4d 100644
--- a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp
+++ b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp
@@ -616,10 +616,10 @@ void Manager::Private::showNotification(
 				actions.push_back(
 					tr::lng_notification_reply(tr::now).toStdString());
 			}
-
-			actions.push_back({});
 		}
 
+		actions.push_back({});
+
 		if (HasCapability("action-icons")) {
 			hints.insert_value(
 				"action-icons",
@@ -774,11 +774,9 @@ void Manager::Private::showNotification(
 								info.subtitle.toHtmlEscaped(),
 								info.message.toHtmlEscaped()).toStdString()
 						: info.message.toStdString()).c_str(),
-					!actions.empty()
-						? (actions
-							| ranges::views::transform(&gi::cstring::c_str)
-							| ranges::to_vector).data()
-						: nullptr,
++					(actions
+						| ranges::views::transform(&gi::cstring::c_str)
+						| ranges::to_vector).data(),
 					hints.end().gobj_(),
 					-1,
 					nullptr,
