From cb7016a21e40d345cd6bfd681ad2041a4414878e Mon Sep 17 00:00:00 2001 From: KOWX712 Date: Sat, 24 May 2025 03:05:19 +0800 Subject: [PATCH] fix: handle possible error --- module/webui/scripts/main.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/module/webui/scripts/main.js b/module/webui/scripts/main.js index 61eb1a6..4e146db 100644 --- a/module/webui/scripts/main.js +++ b/module/webui/scripts/main.js @@ -27,8 +27,12 @@ let isRefreshing = false; // Function to set basePath async function getBasePath() { - const { errno } = await exec('[ -d /data/adb/modules/.TA_utl ]'); - basePath = errno === 0 ? "/data/adb/modules/.TA_utl" : "/data/adb/modules/TA_utl"; + try { + const { errno } = await exec('[ -d /data/adb/modules/.TA_utl ]'); + basePath = errno === 0 ? "/data/adb/modules/.TA_utl" : "/data/adb/modules/TA_utl"; + } catch (error) { + console.error("Error getting base path:", error); + } } // Function to load the version from module.prop