Add truthy check for data.policies before calling 'includes' on it (#9467)

This commit is contained in:
Chelsea Shaw 2020-07-13 15:07:25 -05:00 committed by GitHub
parent cf354f6438
commit 55f6993a5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
}
});