From 375886c591f5a8f393fd55023fecff4187616c4c Mon Sep 17 00:00:00 2001 From: Sondre Olsen Date: Wed, 21 Aug 2024 09:59:51 +0200 Subject: [PATCH] Check for undefined globalValue This commit changes the check for global values of the frontend env variables from a non-null assertion to a check for existence (not undefined). When performing a non-null assertion, in the dockerized verison of the app, empty, defined env vars would be caught as unset. --- frontend/src/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/config.ts b/frontend/src/config.ts index 5eb1285c1..f0e8b03bd 100644 --- a/frontend/src/config.ts +++ b/frontend/src/config.ts @@ -9,7 +9,7 @@ const getEnvVariable = (name: string): string => { // If global value equals its placeholder value 'placeholderValue', it is considered undefined const placeholderValue: string = '${' + name + '}' - if (globalValue === placeholderValue || !globalValue) + if (globalValue === placeholderValue || globalValue === undefined) throw new Error( `Global variable "${name}" is not set. Verify that your .env file is up to date with .env.example` )