Skip to content

Commit

Permalink
Catching the possible problem with the role: #2912
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanBluefox committed Jan 22, 2025
1 parent 22e2bd9 commit 44c08f9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/adapter-react-v5/src/Components/ObjectBrowser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1630,7 +1630,11 @@ function buildTree(
const common = obj.common;
const role = common?.role;
if (role && !info.roles.find(it => it.role === role)) {
info.roles.push({ role, type: common.type });
if (typeof role !== 'string') {
console.warn(`Invalid role type "${typeof role}" in "${obj._id}"`);
} else {
info.roles.push({ role, type: common.type });
}
} else if (id.startsWith('enum.rooms.')) {
info.roomEnums.push(id);
info.enums.push(id);
Expand Down

0 comments on commit 44c08f9

Please sign in to comment.