@@ -87,8 +87,7 @@ export class InboundFilters implements Integration {
8787 }
8888
8989 try {
90- // tslint:disable-next-line:no-unsafe-any
91- return ( event as any ) . exception . values [ 0 ] . type === 'SentryError' ;
90+ return event && event . exception && event . exception . values && event . exception . values [ 0 ] && event . exception . values [ 0 ] . type === 'SentryError' || false ;
9291 } catch ( _oO ) {
9392 return false ;
9493 }
@@ -147,8 +146,7 @@ export class InboundFilters implements Integration {
147146 }
148147 if ( event . exception ) {
149148 try {
150- // tslint:disable-next-line:no-unsafe-any
151- const { type, value } = ( event as any ) . exception . values [ 0 ] ;
149+ const { type = '' , value = '' } = event . exception . values && event . exception . values [ 0 ] || { } ;
152150 return [ `${ value } ` , `${ type } : ${ value } ` ] ;
153151 } catch ( oO ) {
154152 logger . error ( `Cannot extract message for event ${ getEventDescription ( event ) } ` ) ;
@@ -162,14 +160,12 @@ export class InboundFilters implements Integration {
162160 private _getEventFilterUrl ( event : Event ) : string | null {
163161 try {
164162 if ( event . stacktrace ) {
165- // tslint:disable:no-unsafe-any
166- const frames = ( event as any ) . stacktrace . frames ;
167- return frames [ frames . length - 1 ] . filename ;
163+ const frames = event . stacktrace . frames ;
164+ return frames && frames [ frames . length - 1 ] . filename || null ;
168165 }
169166 if ( event . exception ) {
170- // tslint:disable:no-unsafe-any
171- const frames = ( event as any ) . exception . values [ 0 ] . stacktrace . frames ;
172- return frames [ frames . length - 1 ] . filename ;
167+ const frames = event . exception . values && event . exception . values [ 0 ] . stacktrace && event . exception . values [ 0 ] . stacktrace . frames ;
168+ return frames && frames [ frames . length - 1 ] . filename || null ;
173169 }
174170 return null ;
175171 } catch ( oO ) {
0 commit comments