Skip to content

Commit

Permalink
add error message
Browse files Browse the repository at this point in the history
  • Loading branch information
ncukondo committed Feb 28, 2024
1 parent 1b469b0 commit bf90238
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/pages/movies/list/[...paths].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ const CannotFindPage = () => {

const MovieListPage: NextPage<PageProps> = ({ data, category }: PageProps) => {
const { t } = useTranslation("@pages/movies");
if (!data || data.length === 0) console.error("No data found for category: " + category);
if (!data || data.length === 0) return <CannotFindPage />;
const pageTitle = "subCategory" in category ? category.subCategory : category.category;
const movieData = data.filter(isMovieData);
Expand Down

0 comments on commit bf90238

Please sign in to comment.