PermissionsViewer: dont break with missing position edge case
This commit is contained in:
parent
e272a50e3b
commit
0720b1f643
1 changed files with 4 additions and 1 deletions
|
|
@ -56,6 +56,9 @@ export function sortPermissionOverwrites<T extends { id: string; type: number; }
|
|||
const roleA = roles[a.id];
|
||||
const roleB = roles[b.id];
|
||||
|
||||
return roleB.position - roleA.position;
|
||||
const posA = roleA?.position ?? -Infinity;
|
||||
const posB = roleB?.position ?? -Infinity;
|
||||
|
||||
return posB - posA;
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue