Skip to content

Commit e441b5f

Browse files
committed
Improve error logging
1 parent 8896a67 commit e441b5f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/app/conf/2025/schedule/[id]/page.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ import { formatDescription } from "./format-description"
2626
type SessionProps = { params: { id: string } }
2727

2828
export function generateMetadata({ params }: SessionProps): Metadata {
29-
const event = schedule.find(s => s.id === params.id)!
29+
const event = schedule.find(s => s.id === params.id)
30+
31+
if (!event) {
32+
throw new Error(`Session "${params.id}" not found`)
33+
}
3034

3135
const keywords = [
3236
event.event_type,

0 commit comments

Comments
 (0)