Skip to content

Commit

Permalink
Fix issue where app wall list failed to filter spaces when in maxed s…
Browse files Browse the repository at this point in the history
…tate (#4662)

- The following code now fails
  ```
  export enum QParamJoiners {
    in = ' IN ',
  }
  ```
  ```
  QParamJoiners[' IN ']
  ```
- Ensure we access this safer
  • Loading branch information
richard-cox authored Oct 13, 2020
1 parent ecec358 commit 884b9b6
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/frontend/packages/cloud-foundry/src/shared/q-param.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ export class QParam {
}
}, null as []);
if (qParamComponents && qParamComponents.length === 3) {
return new QParam(
qParamComponents[0],
qParamComponents[1],
QParamJoiners[qParamComponents[2]]
);
const legitJoiner = Object.values(QParamJoiners).find(joiner => joiner === qParamComponents[2]);
if (legitJoiner) {
return new QParam(
qParamComponents[0],
qParamComponents[1],
legitJoiner
);
}
}
return null;
}
Expand Down

0 comments on commit 884b9b6

Please sign in to comment.