fix: ignore client providing not-an-id in recipe ids array
All checks were successful
Build / build (push) Successful in 58s
Build / build (pull_request) Successful in 1m27s

This commit is contained in:
Sainan 2025-05-06 03:05:56 +02:00
parent e2fe406017
commit 07e4ea10cf

View File

@ -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}`);