[*Theme] ColorPalette: Add no val abort

This commit is contained in:
Ducko 2021-07-20 19:44:56 +01:00 committed by Alyxia Sother
parent 79db05e7dc
commit 7762d0bd07
No known key found for this signature in database
GPG key ID: 355968D14144B739

View file

@ -115,8 +115,20 @@ export default async (manifest, _content, repo) => {
break;
}
let abortNoVal = false;
while (v[1].startsWith('var(')) {
v[1] = variables.find((y) => y[0] === v[1].slice(4, -1))[1];
v[1] = variables.find((y) => y[0] === v[1].slice(4, -1))?.[1];
if (!v[1]) {
abortNoVal = true;
break;
}
}
if (abortNoVal) {
console.log('aborting color palette image, could not find var substitute', wanted);
break;
}
imagePalette.push([v[0], v[1]]);