File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import clsx from "clsx"
66import { metadata as layoutMetadata } from "@/app/conf/2023/layout"
77
88import { speakers , schedule } from "../../_data"
9- import { ScheduleSession } from "../../../2023/types"
9+ import { SchedSpeaker , ScheduleSession } from "../../../2023/types"
1010
1111import { findVideo , SessionVideo } from "./session-video"
1212import { NavbarPlaceholder } from "../../components/navbar"
@@ -55,10 +55,15 @@ export default function SessionPage({ params }: SessionProps) {
5555 notFound ( )
5656 }
5757
58- // @ts -expect-error -- fixme
59- session . speakers = ( session . speakers || [ ] ) . map ( speaker =>
60- speakers . find ( s => s . username === speaker . username ) ,
61- )
58+ session . speakers = ( session . speakers || [ ] ) . map ( speaker => {
59+ const found = speakers . find ( s => s . username === speaker . username )
60+ if ( ! found ) {
61+ throw new Error (
62+ `Speaker "${ speaker . username } " not found for "${ session . name } "` ,
63+ )
64+ }
65+ return found
66+ } )
6267
6368 const eventTitle = getEventTitle (
6469 session ,
Original file line number Diff line number Diff line change @@ -17,4 +17,4 @@ export function readSpeakers(year: ConferenceYear): SchedSpeaker[] {
1717}
1818
1919// TODO: We need to be able to say that a speaker is returning even if they don't share username, only first name and last name.
20- // But this needs to be done without adding to `~years ` so we don't show duplicates.
20+ // But this needs to be done without adding to `_years ` so we don't show duplicates.
You can’t perform that action at this time.
0 commit comments