Check if imageServers exists before cleaning eval/exec output
This commit is contained in:
parent
6475c91fbc
commit
671ddd8bbe
1 changed files with 5 additions and 3 deletions
|
@ -26,9 +26,11 @@ export async function clean(text) {
|
|||
const { parsed } = config();
|
||||
const imageServers = JSON.parse(fs.readFileSync("./servers.json", { encoding: "utf8" })).image;
|
||||
|
||||
for (const { server, auth } of imageServers) {
|
||||
text = text.replaceAll(server, optionalReplace(server));
|
||||
text = text.replaceAll(auth, optionalReplace(auth));
|
||||
if (imageServers && imageServers.length !== 0) {
|
||||
for (const { server, auth } of imageServers) {
|
||||
text = text.replaceAll(server, optionalReplace(server));
|
||||
text = text.replaceAll(auth, optionalReplace(auth));
|
||||
}
|
||||
}
|
||||
|
||||
for (const env of Object.keys(parsed)) {
|
||||
|
|
Loading…
Reference in a new issue