Skip to content

Commit

Permalink
fix: check flag exists
Browse files Browse the repository at this point in the history
  • Loading branch information
peterphanouvong authored Jul 18, 2023
1 parent 8b5e010 commit bc3f97e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/session/appRouter/getFlag.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const getFlag = (code, defaultValue, flagType) => {
const flags = getClaim('feature_flags');
const flag = flags && flags[code] ? flags[code] : {};

if (!flag.v && defaultValue == undefined) {
if (flag == {} && defaultValue == undefined) {
throw Error(
`Flag ${code} was not found, and no default value has been provided`
);
Expand Down
2 changes: 1 addition & 1 deletion src/session/pagesRouter/getFlag.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const getFlag = (code, defaultValue, flagType) => {
const flags = getClaim('feature_flags');
const flag = flags && flags[code] ? flags[code] : {};

if (!flag.v && defaultValue == undefined) {
if (flag == {} && defaultValue == undefined) {
throw Error(
`Flag ${code} was not found, and no default value has been provided`
);
Expand Down

0 comments on commit bc3f97e

Please sign in to comment.