themes: ignore non theme files

This commit is contained in:
V 2023-08-19 01:33:39 +02:00
parent e699ea63c7
commit 72ce7a5ad1
No known key found for this signature in database
GPG Key ID: A1DC0CFB5615D905

@ -53,10 +53,12 @@ async function listThemes(): Promise<UserThemeHeader[]> {
const themeInfo: UserThemeHeader[] = []; const themeInfo: UserThemeHeader[] = [];
for (const fileName of files) { for (const fileName of files) {
if (!fileName.endsWith(".css")) continue;
const data = await getThemeData(fileName).then(stripBOM).catch(() => null); const data = await getThemeData(fileName).then(stripBOM).catch(() => null);
if (!data) continue; if (data == null) continue;
const parsed = getThemeInfo(data, fileName);
themeInfo.push(parsed); themeInfo.push(getThemeInfo(data, fileName));
} }
return themeInfo; return themeInfo;