From 26cb7ada92e4500b53b8094f98fea679a733879a Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Wed, 16 Apr 2025 05:21:04 +0200 Subject: [PATCH] ensure Rush request has CategoryItemId --- src/controllers/api/guildTechController.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/controllers/api/guildTechController.ts b/src/controllers/api/guildTechController.ts index 5de2a00a..257434fb 100644 --- a/src/controllers/api/guildTechController.ts +++ b/src/controllers/api/guildTechController.ts @@ -305,10 +305,10 @@ export const guildTechController: RequestHandler = async (req, res) => { guild.ActiveDojoColorResearch = data.RecipeType; await guild.save(); res.end(); - } else if (data.Action == "Rush") { + } else if (data.Action == "Rush" && data.CategoryItemId) { const inventoryChanges: IInventoryChanges = { ...updateCurrency(inventory, 20, true), - ...claimSalvagedComponent(inventory, data.CategoryItemId!) + ...claimSalvagedComponent(inventory, data.CategoryItemId) }; await inventory.save(); res.json({ @@ -316,7 +316,7 @@ export const guildTechController: RequestHandler = async (req, res) => { }); } else { logger.debug(`data provided to ${req.path}: ${String(req.body)}`); - throw new Error(`unknown guildTech action: ${data.Action}`); + throw new Error(`unhandled guildTech request`); } };