From 5ff9a5692b7c1155371557d1d449920bcabfdb11 Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Tue, 4 Jul 2023 16:52:43 +0200 Subject: [PATCH] More robust handing of empty PLUGS list --- plugs/core/plugmanager.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugs/core/plugmanager.ts b/plugs/core/plugmanager.ts index 4a845dae..da5b0218 100644 --- a/plugs/core/plugmanager.ts +++ b/plugs/core/plugmanager.ts @@ -13,6 +13,13 @@ export async function updatePlugsCommand() { let plugList: string[] = []; try { 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"); if (plugList.length !== plugListRead.length) { throw new Error(