From f6cbc02c47c392fc4df0e8e38e963ff96cb1ab0d Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Tue, 6 May 2025 02:29:23 -0700 Subject: [PATCH] fix: ignore client providing not-an-id in recipe ids array (#1990) Closes #1989 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1990 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com> --- src/controllers/api/startRecipeController.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/api/startRecipeController.ts b/src/controllers/api/startRecipeController.ts index 495b8d26..78adf1fc 100644 --- a/src/controllers/api/startRecipeController.ts +++ b/src/controllers/api/startRecipeController.ts @@ -41,7 +41,7 @@ export const startRecipeController: RequestHandler = async (req, res) => { ]; for (let i = 0; i != recipe.ingredients.length; ++i) { - if (startRecipeRequest.Ids[i]) { + if (startRecipeRequest.Ids[i] && startRecipeRequest.Ids[i][0] != "/") { const category = ExportWeapons[recipe.ingredients[i].ItemType].productCategory; if (category != "LongGuns" && category != "Pistols" && category != "Melee") { throw new Error(`unexpected equipment ingredient type: ${category}`);