Skip to content

Commit

Permalink
check property before read
Browse files Browse the repository at this point in the history
  • Loading branch information
HalcyonJAC committed Dec 9, 2022
1 parent 57215b1 commit 857a1fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/store/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const module = {
return state.currentUser.email;
},
hasPermissions: state => permissions => {
const rolePermissions = state.currentUser.rolePermissions;
const rolePermissions = state.currentUser ? state.currentUser.rolePermissions : null;
return rolePermissions && Array.isArray(rolePermissions) && permissions.every(p => rolePermissions.includes(p));
},
},
Expand Down

0 comments on commit 857a1fe

Please sign in to comment.