Skip to content

Commit

Permalink
Merge pull request #3818 from mozilla/mntor-2609
Browse files Browse the repository at this point in the history
Return 404 page for non-existent breach details
  • Loading branch information
flozia authored Dec 5, 2023
2 parents 19bd33c + 58e1108 commit 5cacd73
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

import Image, { StaticImageData } from "next/image";
import { notFound } from "next/navigation";
import BreachDetailScanImage from "../../../../../client/images/breach-detail-scan.svg";
import "../../../../../client/css/partials/breachDetail.css";
import { getL10n } from "../../../../functions/server/l10n";
Expand Down Expand Up @@ -81,6 +82,10 @@ export default async function BreachDetail(props: {
const allBreaches = await getBreaches();
const breach = getBreachByName(allBreaches, breachName);

if (!breach) {
return notFound();
}

return (
<div data-partial="breachDetail">
<header className="breach-detail-header">
Expand Down

0 comments on commit 5cacd73

Please sign in to comment.