Skip to content

Commit e76d281

Browse files
committed
fix(browser): Make sure that document.head or document.body exists for injectReportDialog
1 parent 0d1637c commit e76d281

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/browser/src/helpers.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,5 +211,9 @@ export function injectReportDialog(options: ReportDialogOptions = {}): void {
211211
script.onload = options.onLoad;
212212
}
213213

214-
(document.head || document.body).appendChild(script);
214+
const injectionPoint = document.head || document.body;
215+
216+
if (injectionPoint) {
217+
injectionPoint.appendChild(script);
218+
}
215219
}

0 commit comments

Comments
 (0)