From 1657e5a151cd28f2b805cbf56798b8b6749ed615 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 8 Apr 2022 10:54:40 +0200 Subject: [PATCH] fix: no line during buildLog --- src/lib/common.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/lib/common.ts b/src/lib/common.ts index 4eec73539..57cdabba2 100644 --- a/src/lib/common.ts +++ b/src/lib/common.ts @@ -52,12 +52,14 @@ export const sentry = Sentry; export const uniqueName = () => uniqueNamesGenerator(customConfig); export const saveBuildLog = async ({ line, buildId, applicationId }) => { - if (line.includes('ghs_')) { - const regex = /ghs_.*@/g; - line = line.replace(regex, '@'); + if (line) { + if (line.includes('ghs_')) { + const regex = /ghs_.*@/g; + line = line.replace(regex, '@'); + } + const addTimestamp = `${generateTimestamp()} ${line}`; + return await buildLogQueue.add(buildId, { buildId, line: addTimestamp, applicationId }); } - const addTimestamp = `${generateTimestamp()} ${line}`; - return await buildLogQueue.add(buildId, { buildId, line: addTimestamp, applicationId }); }; export const isTeamIdTokenAvailable = (request) => {