Skip to content

Commit

Permalink
prevent crash from undefined title tag
Browse files Browse the repository at this point in the history
  • Loading branch information
futurepastori committed Sep 1, 2020
1 parent 6f60a22 commit 22e6e48
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/next/client/head-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 22e6e48

Please sign in to comment.