Skip to content

Commit

Permalink
fix(browser): Make sure that document.head or document.body exists fo…
Browse files Browse the repository at this point in the history
…r injectReportDialog (#3972)
  • Loading branch information
kamilogorek committed Sep 10, 2021
1 parent 0d1637c commit 6b21d76
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/browser/src/helpers.ts
Expand Up @@ -211,5 +211,9 @@ export function injectReportDialog(options: ReportDialogOptions = {}): void {
script.onload = options.onLoad;
}

(document.head || document.body).appendChild(script);
const injectionPoint = document.head || document.body;

if (injectionPoint) {
injectionPoint.appendChild(script);
}
}

0 comments on commit 6b21d76

Please sign in to comment.