From 688746cf7f3862a9d1060e7ac4d4d924db0307f5 Mon Sep 17 00:00:00 2001 From: James Yu Date: Sun, 19 Nov 2023 16:51:23 +0000 Subject: [PATCH] Fix a !LW recipe not found fallback issue --- src/components/builder.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/builder.ts b/src/components/builder.ts index 1c4307631..96ad99319 100644 --- a/src/components/builder.ts +++ b/src/components/builder.ts @@ -572,7 +572,11 @@ export class Builder { } // Find default recipe of last used if (recipe === undefined && defaultRecipeName === 'lastUsed') { - recipe = this.prevRecipe + const candidates = recipes.filter(candidate => candidate.name === this.prevRecipe?.name) + if (candidates.length < 1) { + logger.log(`Failed to resolve previous build recipe: ${recipeName}.`) + } + recipe = candidates[0] } // If still not found, fallback to 'first' if (recipe === undefined) {