Skip to content

Commit

Permalink
fix: check title element
Browse files Browse the repository at this point in the history
  • Loading branch information
liximomo committed May 19, 2020
1 parent 0439666 commit 47505e9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/runtime-react/src/head/head-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ export default class HeadManager {
private _updateTitle({ attrs }: HeadItem) {
const title = attrs.textContent || '';
if (title !== document.title) document.title = title;
assignAttributes(document.getElementsByTagName('title')[0], attrs);
const titleEle = document.getElementsByTagName('title')[0];
if (titleEle) {
assignAttributes(titleEle, attrs);
}
}

private _updateElements(type: string, tags: HeadItem[]) {
Expand Down

0 comments on commit 47505e9

Please sign in to comment.