From 20c20e5d5a885a636704fbd4befd0cd150c3e075 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E5=8B=A4=E6=B0=91?= Date: Wed, 20 Aug 2025 18:45:53 +0800 Subject: [PATCH] =?UTF-8?q?refactor(basic):=20=E4=BC=98=E5=8C=96=E4=B8=BB?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E8=8E=B7=E5=8F=96=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将判断错误码的条件从 if (errCode) 修改为 if (errCode !== 0) - 这样可以更准确地处理错误情况,避免潜在的逻辑错误 --- src/main/ets/ContextConfig.ets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/ets/ContextConfig.ets b/src/main/ets/ContextConfig.ets index cece028..0ee97d6 100644 --- a/src/main/ets/ContextConfig.ets +++ b/src/main/ets/ContextConfig.ets @@ -21,7 +21,7 @@ export class GlobalContext { context.windowStage.getMainWindow((err: BusinessError, data) => { let errCode: number = err.code; - if (errCode) { + if (errCode !== 0) { console.error(`Failed to obtain the main window. Cause code: ${err.code}, message: ${err.message}`); return; }