fix: handle possible error

This commit is contained in:
KOWX712
2025-05-24 03:05:19 +08:00
parent b21ed9b662
commit cb7016a21e

View File

@@ -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