Skip to content

Commit

Permalink
#63 fix roles array may be undefined if user is not member of abteilung
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Preisig committed Nov 5, 2023
1 parent 8e0c6da commit cbde724
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/material/MaterialGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const MaterialGrid = (props: MaterialGridProps) => {

const userState = useUser();

const filteredMaterials = userState.appUser?.userData.roles[abteilungId].includes('guest') ?
const filteredMaterials = (userState.appUser?.userData?.roles|| {})[abteilungId]?.includes('guest') ?
material.filter(material => !material.onlyLendInternal) : material;

return <>
Expand Down

0 comments on commit cbde724

Please sign in to comment.