Skip to content

Scheduling infrastructure for absolutely everyone.

fix: Avoid typescript error for Nextjs usePathname() (#16368)

Johannes Zellner7aae55f417ba
diff --git a/packages/features/shell/Shell.tsx b/packages/features/shell/Shell.tsx
index 1d78879fb74..7a8a7fead3b 100644
--- a/packages/features/shell/Shell.tsx
+++ b/packages/features/shell/Shell.tsx
@@ -215,7 +215,7 @@ const useBanners = () => {
const Layout = (props: LayoutProps) => {
const banners = useBanners();
const pathname = usePathname();
- const isFullPageWithoutSidebar = pathname.startsWith("/apps/routing-forms/reporting/");
+ const isFullPageWithoutSidebar = pathname?.startsWith("/apps/routing-forms/reporting/");
const { data: user } = trpc.viewer.me.useQuery();
const { boot } = useIntercom();
const pageTitle = typeof props.heading === "string" && !props.title ? props.heading : props.title;