Skip to content

Commit

Permalink
Show 404 if video not found
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenyeargin committed Jan 20, 2025
1 parent 0701bf9 commit 1809e15
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app/video/[slug]/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import React, { useState, useEffect } from 'react';
import NewsPageSkeleton from '@/app/components/NewsPageSkeleton';
import { useParams } from 'next/navigation';
import { notFound, useParams } from 'next/navigation';
import { formatHeadTitle, formatLocalizedDate, formatLocalizedTime } from '@/app/utils/formatters';
import Link from 'next/link';
import { faFilm, faVideoCamera } from '@fortawesome/free-solid-svg-icons';
Expand Down Expand Up @@ -31,6 +31,10 @@ const VideoItemPage = () => {
return <NewsPageSkeleton />;
}

if (video.status === 404) {
return notFound();
}

const { fields } = video;
formatHeadTitle(video.title);

Expand Down

0 comments on commit 1809e15

Please sign in to comment.