Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
Legger til optional chaining for sjekk mot feature
Browse files Browse the repository at this point in the history
  • Loading branch information
terjeofnorway committed Oct 10, 2023
1 parent da4794a commit cf936b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/server/api-handlers/features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const initializeUnleash = async () => {

const resolveRequestedFeatures = (requestedFeatures: string[]) => {
return requestedFeatures.reduce((acc: Features, feature: string) => {
acc[feature] = unleashInstance.isSynchronized() ? unleashInstance.isEnabled(feature) : defaultToggles[feature];
acc[feature] = unleashInstance?.isSynchronized() ? unleashInstance.isEnabled(feature) : defaultToggles[feature];
return acc;
}, {});
};
Expand Down

0 comments on commit cf936b6

Please sign in to comment.