diff --git a/src/components/routes/Stats/Player/Main.tsx b/src/components/routes/Stats/Player/Main.tsx index 0038b70..aa236df 100644 --- a/src/components/routes/Stats/Player/Main.tsx +++ b/src/components/routes/Stats/Player/Main.tsx @@ -50,8 +50,9 @@ export function ComponentHandling( ): React.ReactElement { if (props.isError) { if ( - typeof props.errors == "object" && - props.errors.includes("Player not found") + typeof props?.errors == "object" && + typeof props?.errors?.includes === 'function' && + props?.errors?.includes("Player not found") ) { return t("notApplicable"); } @@ -163,9 +164,8 @@ function Stats(): React.ReactElement { } }, [game, history]); const { t } = useTranslation(); - document.title = `${t("siteFullName")} ${t("pageTitle.stats")} | ${ - playerGames?.userName || t("loading") - } | ${game || t("notApplicable")}`; + document.title = `${t("siteFullName")} ${t("pageTitle.stats")} | ${playerGames?.userName || t("loading") + } | ${game || t("notApplicable")}`; return (