From 17f715f870c78d729cae5c07fbcbf766fc19f91e Mon Sep 17 00:00:00 2001 From: jevons0411 Date: Tue, 20 Sep 2022 18:19:57 +0800 Subject: [PATCH] Update SrcHelper.js --- SrcHelper.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/SrcHelper.js b/SrcHelper.js index 2f08bd4b..ef9bdeb7 100644 --- a/SrcHelper.js +++ b/SrcHelper.js @@ -2,12 +2,16 @@ function homepage(helper) { var cloudVersion = 7.01;//插件版本号,判断是否需要更新 if (!fileExist('hiker://files/rules/Src/Auto/config.json')&&fileExist('hiker://files/cache/SrcSet.js')) { - eval(fetch('hiker://files/cache/SrcSet.js').replace('userconfig','oldconfig')); - writeFile('hiker://files/rules/Src/Auto/config.json', JSON.stringify(oldconfig)); + try{ + eval(fetch('hiker://files/cache/SrcSet.js').replace('userconfig','oldconfig')); + writeFile('hiker://files/rules/Src/Auto/config.json', JSON.stringify(oldconfig)); + }catch(e){} } if (!fileExist('hiker://files/rules/Src/Auto/SrcSort.json')&&fileExist('hiker://files/cache/SrcSort.json')) { - eval("var oldsort=" + fetch('hiker://files/cache/SrcSort.json')); - writeFile('hiker://files/rules/Src/Auto/SrcSort.json', JSON.stringify(oldsort)); + try{ + eval("var oldsort=" + fetch('hiker://files/cache/SrcSort.json')); + writeFile('hiker://files/rules/Src/Auto/SrcSort.json', JSON.stringify(oldsort)); + }catch(e){} } var d = [];