More robust handing of empty PLUGS list
parent
56e1489a01
commit
5ff9a5692b
|
@ -13,6 +13,13 @@ export async function updatePlugsCommand() {
|
||||||
let plugList: string[] = [];
|
let plugList: string[] = [];
|
||||||
try {
|
try {
|
||||||
const plugListRead: any[] = await readYamlPage("PLUGS");
|
const plugListRead: any[] = await readYamlPage("PLUGS");
|
||||||
|
if (!Array.isArray(plugListRead)) {
|
||||||
|
await editor.flashNotification(
|
||||||
|
"PLUGS YAML does not contain a plug list, not loading anything",
|
||||||
|
"error",
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
plugList = plugListRead.filter((plug) => typeof plug === "string");
|
plugList = plugListRead.filter((plug) => typeof plug === "string");
|
||||||
if (plugList.length !== plugListRead.length) {
|
if (plugList.length !== plugListRead.length) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
|
Loading…
Reference in New Issue