fix: guard missing autostart desktop entry#369
Conversation
There was a problem hiding this comment.
Sorry @yixinshark, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
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
4e55e06 to
7e3eaaa
Compare
deepin pr auto review★ 总体评分:100分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 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 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: robertkill, yixinshark The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/forcemerge |
|
This pr force merged! (status: blocked) |
Summary
Test plan
Pms: BUG-366575