From 7e3eaaa4723a16098ba10261cbb620c9c80918de Mon Sep 17 00:00:00 2001 From: zhaoyingzhen Date: Wed, 17 Jun 2026 09:34:05 +0800 Subject: [PATCH] fix: guard missing autostart desktop entry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prevent ApplicationService::Launch from dereferencing a null DesktopEntry when an autostart launch is requested for an application without an autostart source. The method now logs the affected application context, sends the existing D-Bus error, and returns immediately. 防止 ApplicationService::Launch 在自启动请求缺少 autostart source 时解引用空的 DesktopEntry。现在会记录受影响应用的上下文,发送原有 D-Bus 错误,并立即返回。 Log: guard missing autostart desktop entry Pms: BUG-366575 Change-Id: I6358d814ed3d620d9d7debf83ee67a80a24fec2f --- src/dbus/applicationservice.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/dbus/applicationservice.cpp b/src/dbus/applicationservice.cpp index 4a0a4bb2..4626f45e 100644 --- a/src/dbus/applicationservice.cpp +++ b/src/dbus/applicationservice.cpp @@ -406,7 +406,13 @@ QDBusObjectPath ApplicationService::Launch(const QString &action, const QStringL }(); if (desktopEntry == nullptr) { - safe_sendErrorReply(QDBusError::Failed, "This application is not set to autostart."); + const QString msg = "This application is not set to autostart."; + qWarning() << msg << "app:" << id() + << "isAutostartLaunch:" << isAutostartLaunch + << "desktopSource:" << m_desktopSource.sourcePath() + << "autostartSource:" << m_autostartSource.m_filePath; + safe_sendErrorReply(QDBusError::Failed, msg); + return {}; } // ignore action if it's not supported or autostart launch