@@ -87,8 +87,7 @@ export class InboundFilters implements Integration {
87
87
}
88
88
89
89
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 ;
92
91
} catch ( _oO ) {
93
92
return false ;
94
93
}
@@ -147,8 +146,7 @@ export class InboundFilters implements Integration {
147
146
}
148
147
if ( event . exception ) {
149
148
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 ] || { } ;
152
150
return [ `${ value } ` , `${ type } : ${ value } ` ] ;
153
151
} catch ( oO ) {
154
152
logger . error ( `Cannot extract message for event ${ getEventDescription ( event ) } ` ) ;
@@ -162,14 +160,12 @@ export class InboundFilters implements Integration {
162
160
private _getEventFilterUrl ( event : Event ) : string | null {
163
161
try {
164
162
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 ;
168
165
}
169
166
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 ;
173
169
}
174
170
return null ;
175
171
} catch ( oO ) {
0 commit comments