From a3ffb16ca6fce5cfd81649c80bfd55bb2f4ee076 Mon Sep 17 00:00:00 2001 From: 52cyb Date: Thu, 20 Aug 2026 20:37:31 +0800 Subject: [PATCH] fix: guard SystemProxyConfigItem hasAuth binding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Add null guard to hasAuth binding in SystemProxyConfigItem.qml 2. config is undefined during async manualProxy data load 3. Use !!(config && config.auth) to avoid TypeError warning Log: Eliminated TypeError warning when opening system proxy settings Influence: 1. Open control center network system proxy page 2. Verify no TypeError at SystemProxyConfigItem.qml:17 3. Check manual/auto proxy switch, auth toggle and save fix: 修复系统代理配置项 hasAuth 绑定空安全 1. 为 SystemProxyConfigItem.qml 的 hasAuth 绑定增加空安全守卫 2. manualProxy 数据跨线程异步加载,组件实例化时 config 为 undefined 3. 改用 !!(config && config.auth) 避免 TypeError 运行警告 Log: 消除打开系统代理设置时的 TypeError 运行警告 Influence: 1. 进入控制中心-网络-系统代理页面 2. 确认 SystemProxyConfigItem.qml:17 不再报 TypeError 3. 验证手动/自动代理切换、认证开关及保存功能正常 PMS: TASK-392413 https://pms.uniontech.com/task-view-392413.html --- dcc-network/qml/SystemProxyConfigItem.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dcc-network/qml/SystemProxyConfigItem.qml b/dcc-network/qml/SystemProxyConfigItem.qml index 59a07af9e..18cc51694 100644 --- a/dcc-network/qml/SystemProxyConfigItem.qml +++ b/dcc-network/qml/SystemProxyConfigItem.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2024 - 2027 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd. // SPDX-License-Identifier: GPL-3.0-or-later import QtQuick 2.15 import QtQuick.Controls 2.15 @@ -14,7 +14,7 @@ import org.deepin.dcc.network 1.0 DccObject { id: root property var config: null - property bool hasAuth: config.auth + property bool hasAuth: !!(config && config.auth) property bool hasUrl: false property string errorKey: ""