From 70aae7c59ae94273f3275ff7fa3324d0459cbf91 Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Tue, 24 Dec 2024 20:13:21 +0000 Subject: [PATCH] fix: update RedisIPFamily initialization to handle undefined environment variable --- Common/Server/EnvironmentConfig.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Common/Server/EnvironmentConfig.ts b/Common/Server/EnvironmentConfig.ts index 97130659ee4..a5e149e1a85 100644 --- a/Common/Server/EnvironmentConfig.ts +++ b/Common/Server/EnvironmentConfig.ts @@ -181,8 +181,9 @@ export const ShouldRedisTlsEnable: boolean = Boolean( RedisTlsCa || (RedisTlsCert && RedisTlsKey), ); -export const RedisIPFamily: number = - Number(process.env["REDIS_IP_FAMILY"]) || 4; +export const RedisIPFamily: number = process.env["REDIS_IP_FAMILY"] + ? Number(process.env["REDIS_IP_FAMILY"]) + : 4; export const IsProduction: boolean = process.env["ENVIRONMENT"] === "production";