Skip to content

Commit

Permalink
Merge branch 'main' into fix/642
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanThatOneKid committed Nov 5, 2022
2 parents 6175dc6 + 22ae77d commit 183d301
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/routes/(site)/about/officer-profile-list.svelte
Expand Up @@ -24,9 +24,12 @@
*/
function sortByTier(termCode: Term) {
return (a: Officer, b: Officer) => {
const aTier = a.positions[termCode]!.tier;
const bTier = b.positions[termCode]!.tier;
return aTier - bTier;
const aPos = a.positions[termCode];
const bPos = b.positions[termCode];
if (!aPos || !bPos) {
throw new Error(`a or b has no position`);
}
return aPos.tier - bPos.tier;
};
}
Expand Down

0 comments on commit 183d301

Please sign in to comment.