From d91292f532234a6affb2fe31206bcad532f5dae8 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 3 May 2024 16:21:35 +0200 Subject: [PATCH] Handle null or empty on processor --- .../rowProcessor/bbReferenceProcessor.ts | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/packages/server/src/utilities/rowProcessor/bbReferenceProcessor.ts b/packages/server/src/utilities/rowProcessor/bbReferenceProcessor.ts index 325b3b37ba..d69fe73052 100644 --- a/packages/server/src/utilities/rowProcessor/bbReferenceProcessor.ts +++ b/packages/server/src/utilities/rowProcessor/bbReferenceProcessor.ts @@ -108,14 +108,9 @@ interface UserReferenceInfo { } export async function processOutputBBReference( - value: string, + value: string | null | undefined, subtype: BBReferenceFieldSubType.USER ): Promise { - if (value === null || value === undefined) { - // Already processed or nothing to process - return value || undefined - } - if (!value) { return undefined } @@ -148,14 +143,12 @@ export async function processOutputBBReference( } export async function processOutputBBReferences( - value: string, + value: string | null | undefined, subtype: BBReferenceFieldSubType ): Promise { - if (value === null || value === undefined) { - // Already processed or nothing to process - return value || undefined + if (!value) { + return undefined } - const ids = typeof value === "string" ? value.split(",").filter(id => !!id) : value