From 57442e2b921d435851711525f688ca151ffdd220 Mon Sep 17 00:00:00 2001 From: Gabriel Mechali Date: Wed, 5 Feb 2025 13:12:19 -0800 Subject: [PATCH] Fix custom DC for feature check (#4930) This change plays it safer on the feature check such that if there are no feature flags (like in custom dc instances), this will just return false. --- static/js/shared/feature_flags/util.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/js/shared/feature_flags/util.ts b/static/js/shared/feature_flags/util.ts index cd84addc46..915b698b07 100644 --- a/static/js/shared/feature_flags/util.ts +++ b/static/js/shared/feature_flags/util.ts @@ -26,7 +26,7 @@ export const SCROLL_TO_TOP_FEATURE_FLAG = "scroll_to_top_button"; * @returns Bool describing if the feature is enabled */ export function isFeatureEnabled(featureName: string): boolean { - if (featureName in FEATURE_FLAGS) { + if (FEATURE_FLAGS && featureName in FEATURE_FLAGS) { return FEATURE_FLAGS[featureName]; } return false;