@@ -3,7 +3,7 @@ import { DsnLike, Event, EventHint } from '@sentry/types';
33import { getGlobalObject , logger } from '@sentry/utils' ;
44
55import { BrowserBackend , BrowserOptions } from './backend' ;
6- import { Breadcrumbs } from './integrations' ;
6+ import { Breadcrumbs } from './integrations/index ' ;
77import { SDK_NAME , SDK_VERSION } from './version' ;
88
99/**
@@ -79,20 +79,22 @@ export class BrowserClient extends BaseClient<BrowserBackend, BrowserOptions> {
7979
8080 this . _processEvent ( event , hint , scope )
8181 . then ( finalEvent => {
82- // We need to check for finalEvent in case beforeSend returned null.
83- if ( ! finalEvent ) {
84- return ;
85- }
86- eventId = finalEvent . event_id ;
82+ // We need to check for finalEvent in case beforeSend returned null
83+ eventId = finalEvent && finalEvent . event_id ;
8784 // We do this here to not parse any requests if they are outgoing to Sentry
8885 // We log breadcrumbs if the integration has them enabled
89- const integration = this . getIntegration ( Breadcrumbs ) ;
90- if ( integration ) {
91- integration . addSentryBreadcrumb ( finalEvent ) ;
86+ if ( finalEvent ) {
87+ const integration = this . getIntegration ( Breadcrumbs ) ;
88+ if ( integration ) {
89+ integration . addSentryBreadcrumb ( finalEvent ) ;
90+ }
9291 }
92+ this . _processing = false ;
9393 } )
94- . catch ( reason => logger . error ( reason ) )
95- . finally ( ( ) => ( this . _processing = false ) ) ;
94+ . then ( null , reason => {
95+ logger . error ( reason ) ;
96+ this . _processing = false ;
97+ } ) ;
9698
9799 return eventId ;
98100 }
0 commit comments