fix: fix null pointer and improve DNS/IP configuration#541
Merged
caixr23 merged 1 commit intolinuxdeepin:coredumpfrom Apr 7, 2026
Merged
fix: fix null pointer and improve DNS/IP configuration#541caixr23 merged 1 commit intolinuxdeepin:coredumpfrom
caixr23 merged 1 commit intolinuxdeepin:coredumpfrom
Conversation
Fixed a null pointer access issue in PageSystemProxy.qml by adding a null check before accessing the visibleToApp property. This prevents potential crashes when the ignoreHosts object is not available. Refactored DNS, IPv4, and IPv6 configuration sections to use DccRepeater for dynamic item management instead of manual component creation and destruction. This simplifies the code structure and eliminates the need for separate arrays to track created items. Added helper functions addAddressData() and removeAddressData() to centralize data manipulation logic. In the IPv6 validation logic, added null checks for gateway values to prevent errors when gateway fields are empty. This ensures proper validation of IPv6 configurations. Log: Fixed system proxy page visibility issue and improved DNS/IP configuration management Influence: 1. Test system proxy settings to ensure the "Ignore hosts" option appears correctly 2. Verify DNS configuration by adding and removing DNS servers 3. Test IPv4 configuration by adding multiple IP addresses 4. Test IPv6 configuration with empty and populated gateway fields 5. Validate all network configuration changes are properly saved 6. Check that UI updates correctly when modifying network settings fix: 修复空指针问题并改进DNS/IP配置 修复了PageSystemProxy.qml中的空指针访问问题,在访问visibleToApp属性前添 加了空值检查,防止ignoreHosts对象不可用时导致程序崩溃。 重构了DNS、IPv4和IPv6配置部分,使用DccRepeater进行动态项管理,替代了手动 创建和销毁组件的方式。这简化了代码结构,并消除了单独跟踪已创建项的需要。 添加了addAddressData()和removeAddressData()辅助函数来集中数据操作逻辑。 在IPv6验证逻辑中,为网关值添加了空值检查,防止网关字段为空时出现错误。这 确保了IPv6配置的正确验证。 Log: 修复系统代理页面显示问题并改进DNS/IP配置管理 Influence: 1. 测试系统代理设置,确保"忽略主机"选项正确显示 2. 验证DNS配置,测试添加和删除DNS服务器 3. 测试IPv4配置,添加多个IP地址 4. 测试IPv6配置,包括空和已填充的网关字段 5. 验证所有网络配置更改是否正确保存 6. 检查修改网络设置时UI是否正确更新
Reviewer's GuideRefactors DNS, IPv4, and IPv6 QML sections to use DccRepeater and centralized add/remove helpers instead of manual component management, tightens IPv6 gateway validation with null checks, fixes a potential null pointer in the system proxy page visibility binding, and preserves connectivity state initialization in the NetworkManager processor. Sequence diagram for adding a new DNS server entry with DccRepeatersequenceDiagram
actor User
participant SectionDNS
participant DccRepeater
participant DNSDelegate
participant ConfigArray as config
User->>DNSDelegate: click add_icon MouseArea
DNSDelegate->>SectionDNS: addAddressData("")
SectionDNS->>ConfigArray: push("")
SectionDNS->>SectionDNS: configChanged()
SectionDNS->>SectionDNS: editClicked()
Note over SectionDNS,DccRepeater: DccRepeater observes model root.config
DccRepeater-->>DNSDelegate: create new delegate for new index
DNSDelegate->>User: show new empty DNS input field
Sequence diagram for IPv6 gateway validation with null safetysequenceDiagram
participant SectionIPv6
participant GatewayArray as gateway
SectionIPv6->>SectionIPv6: validateIpv6()
loop for each k in gateway
SectionIPv6->>GatewayArray: read gateway[k]
alt gateway[k] exists and nonempty
SectionIPv6->>SectionIPv6: increment gatewayCount
alt gatewayCount >= 2
SectionIPv6->>SectionIPv6: set errorKey(k + gateway)
SectionIPv6->>SectionIPv6: return false
else gatewayCount < 2
SectionIPv6->>SectionIPv6: test NetUtils.ipv6RegExp(gateway[k])
alt invalid format
SectionIPv6->>SectionIPv6: set errorKey(k + gateway)
SectionIPv6->>SectionIPv6: set errorMsg(Invalid gateway)
SectionIPv6->>SectionIPv6: return false
else valid format
SectionIPv6->>SectionIPv6: continue
end
end
else gateway[k] null or empty
SectionIPv6->>SectionIPv6: skip validation for this k
end
end
SectionIPv6-->>SectionIPv6: return true
Flow diagram for connectivity change handling preserving previous stateflowchart TD
A[onConnectivityChanged called with NetworkManager_Connectivity] --> B[Initialize ctity with m_connectivity]
B --> C{conntity value}
C -->|Full| D[ctity = dde_network_Connectivity_Full]
C -->|Portal| E[ctity = dde_network_Connectivity_Portal]
C -->|Limited| F[ctity = dde_network_Connectivity_Limited]
C -->|None| G[ctity = dde_network_Connectivity_None]
C -->|Unknown or other| H[ctity remains as previous m_connectivity]
D --> I[emit connectivity changed with ctity]
E --> I
F --> I
G --> I
H --> I
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
18202781743
approved these changes
Apr 7, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, caixr23 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixed a null pointer access issue in PageSystemProxy.qml by adding a null check before accessing the visibleToApp property. This prevents potential crashes when the ignoreHosts object is not available.
Refactored DNS, IPv4, and IPv6 configuration sections to use DccRepeater for dynamic item management instead of manual component creation and destruction. This simplifies the code structure and eliminates the need for separate arrays to track created items. Added helper functions addAddressData() and removeAddressData() to centralize data manipulation logic.
In the IPv6 validation logic, added null checks for gateway values to prevent errors when gateway fields are empty. This ensures proper validation of IPv6 configurations.
Log: Fixed system proxy page visibility issue and improved DNS/IP configuration management
Influence:
fix: 修复空指针问题并改进DNS/IP配置
修复了PageSystemProxy.qml中的空指针访问问题,在访问visibleToApp属性前添 加了空值检查,防止ignoreHosts对象不可用时导致程序崩溃。
重构了DNS、IPv4和IPv6配置部分,使用DccRepeater进行动态项管理,替代了手动
创建和销毁组件的方式。这简化了代码结构,并消除了单独跟踪已创建项的需要。
添加了addAddressData()和removeAddressData()辅助函数来集中数据操作逻辑。
在IPv6验证逻辑中,为网关值添加了空值检查,防止网关字段为空时出现错误。这
确保了IPv6配置的正确验证。
Log: 修复系统代理页面显示问题并改进DNS/IP配置管理
Influence:
Summary by Sourcery
Refine network configuration UI behavior and stability across DNS, IPv4/IPv6, and system proxy pages.
Bug Fixes:
Enhancements: