PermissionsViewer: dont break with missing position edge case

This commit is contained in:
thororen1234 2026-07-02 13:52:15 -04:00
parent e272a50e3b
commit 0720b1f643
No known key found for this signature in database

View file

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