Ver Fonte

ignore errors

Gildas há 2 anos atrás
pai
commit
1da3486161
1 ficheiros alterados com 9 adições e 5 exclusões
  1. 9 5
      src/core/bg/config.js

+ 9 - 5
src/core/bg/config.js

@@ -269,11 +269,15 @@ async function upgrade() {
 }
 
 function updateFilenameTemplate(template) {
-	Object.keys(MIGRATION_DEFAULT_VARIABLES_VALUES).forEach(variable => {
-		const value = MIGRATION_DEFAULT_VARIABLES_VALUES[variable];
-		template = template.replaceAll(`{${variable}}`, `%if-empty<{${variable}}|${value}>`);
-	});
-	return template;
+	try {
+		Object.keys(MIGRATION_DEFAULT_VARIABLES_VALUES).forEach(variable => {
+			const value = MIGRATION_DEFAULT_VARIABLES_VALUES[variable];
+			template = template.replaceAll(`{${variable}}`, `%if-empty<{${variable}}|${value}>`);
+		});
+		return template;
+	} catch (_error) {
+		// ignored
+	}
 }
 
 async function getRule(url, ignoreWildcard) {