Explorar o código

ignore errors

Gildas %!s(int64=2) %!d(string=hai) anos
pai
achega
1da3486161
Modificáronse 1 ficheiros con 9 adicións e 5 borrados
  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) {