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

View file

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