Add truthy check for data.policies before calling 'includes' on it (#9467)
This commit is contained in:
parent
cf354f6438
commit
55f6993a5f
|
@ -313,7 +313,7 @@ export default Service.extend({
|
|||
|
||||
this.getTokensFromStorage().forEach(key => {
|
||||
const data = this.getTokenData(key);
|
||||
if (data && data.policies.includes('root')) {
|
||||
if (data && data.policies && data.policies.includes('root')) {
|
||||
this.removeTokenData(key);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue