From 9e0aa1f3fabc5205501d9334d25757a62cd86826 Mon Sep 17 00:00:00 2001 From: beyondkmp Date: Wed, 6 Aug 2025 11:19:41 +0800 Subject: [PATCH] fix(ProxyManager): handle optional currentProxy in system proxy check and log changes (#8865) --- src/main/services/ProxyManager.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/services/ProxyManager.ts b/src/main/services/ProxyManager.ts index 61a667e1f0..0b0df1d6f1 100644 --- a/src/main/services/ProxyManager.ts +++ b/src/main/services/ProxyManager.ts @@ -87,10 +87,11 @@ export class ProxyManager { // Set new interval this.systemProxyInterval = setInterval(async () => { const currentProxy = await getSystemProxy() - if (currentProxy && currentProxy.proxyUrl.toLowerCase() === this.config?.proxyRules) { + if (currentProxy?.proxyUrl.toLowerCase() === this.config?.proxyRules) { return } + logger.info(`system proxy changed: ${currentProxy?.proxyUrl}, this.config.proxyRules: ${this.config.proxyRules}`) await this.configureProxy({ mode: 'system', proxyRules: currentProxy?.proxyUrl.toLowerCase(),