Skip to content

Commit

Permalink
Check for undefined globalValue
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sondreo committed Sep 5, 2024
1 parent f502ccf commit 375886c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`
)
Expand Down

0 comments on commit 375886c

Please sign in to comment.