diff --git a/src/meta_tags.js b/src/meta_tags.js index 4d7f008aa1ffb1cda666eacacb76d1189c462c4b..ab3c1f099f34a14513559f0a6c734a74c1450a15 100644 --- a/src/meta_tags.js +++ b/src/meta_tags.js @@ -53,7 +53,14 @@ class MetaTags extends Component { this.lastChildStr = childStr; - let childNodes = Array.prototype.slice.call(this.temporaryElement.querySelector('.react-head-temp').children); + const tempHead = this.temporaryElement.querySelector('.react-head-temp'); + + // .react-head-temp might not exist when triggered from async action + if (tempHead === null) { + return; + } + + let childNodes = Array.prototype.slice.call(tempHead.children); const head = document.head; const headHtml = head.innerHTML;