From 22e6e485924d192530a7aaede3ee1053586381ba Mon Sep 17 00:00:00 2001 From: Victor Ramirez Date: Tue, 1 Sep 2020 16:53:22 +0200 Subject: [PATCH] prevent crash from undefined title tag --- packages/next/client/head-manager.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/next/client/head-manager.ts b/packages/next/client/head-manager.ts index 424613f75db21..c42553fd9bd8b 100644 --- a/packages/next/client/head-manager.ts +++ b/packages/next/client/head-manager.ts @@ -93,7 +93,9 @@ export default function initHeadManager() { let title = '' if (titleComponent) { const { children } = titleComponent.props - title = typeof children === 'string' ? children : children.join('') + if (children) { + title = typeof children === 'string' ? children : children.join('') + } } if (title !== document.title) document.title = title ;['meta', 'base', 'link', 'style', 'script'].forEach((type) => {