Skip to content

Commit

Permalink
fix(browser): Check for document when sending outcomes (#3993)
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhiPrasad committed Sep 20, 2021
1 parent 4841625 commit 3fcd6d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/browser/src/transports/base.ts
Expand Up @@ -42,7 +42,7 @@ export abstract class BaseTransport implements Transport {
// eslint-disable-next-line deprecation/deprecation
this.url = this._api.getStoreEndpointWithUrlEncodedAuth();

if (this.options.sendClientReports) {
if (this.options.sendClientReports && document) {
document.addEventListener('visibilitychange', () => {
if (document.visibilityState === 'hidden') {
this._flushOutcomes();
Expand Down

0 comments on commit 3fcd6d8

Please sign in to comment.