From ddacd8a158431f1136df757969114f1397eede0c Mon Sep 17 00:00:00 2001 From: Adrian Andersen Date: Wed, 12 Jun 2024 00:47:53 +0200 Subject: [PATCH] fix(match-transfer): do not throw error if there is no previous order --- src/collections/match/operations/match-operation-utils.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/collections/match/operations/match-operation-utils.ts b/src/collections/match/operations/match-operation-utils.ts index fc6a1c0b..f157aed3 100644 --- a/src/collections/match/operations/match-operation-utils.ts +++ b/src/collections/match/operations/match-operation-utils.ts @@ -71,11 +71,9 @@ export async function createMatchOrder( (orderItem) => String(orderItem.item) === String(customerItem.item), ), ); - if (!originalReceiverOrder) { - throw new BlError("Could not find original receiver order"); + if (originalReceiverOrder) { + movedFromOrder = originalReceiverOrder.id; } - - movedFromOrder = originalReceiverOrder.id; } const deadlineOverride = deadlineOverrides?.find( (override) => override.item === item.id,