File tree 1 file changed +3
-5
lines changed
packages/firebase-crashlytics
1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -65,11 +65,9 @@ export class Crashlytics implements ICrashlytics {
65
65
recordError ( error : any ) : void {
66
66
if ( error instanceof Error ) {
67
67
StackTrace . fromError ( error ) . then ( ( stack ) => {
68
- const traceElements = [ ] ;
69
- stack . forEach ( ( item , i ) => {
70
- traceElements [ i ] = FIRStackFrame . stackFrameWithSymbolFileLine ( item . functionName || '(anonymous)' , item . fileName , item . lineNumber ) ;
71
- } ) ;
72
- const e = FIRExceptionModel . exceptionModelWithNameReason ( 'JavaScriptError' , error . message ) ;
68
+ const traceElements = stack . map ( ( item ) => FIRStackFrame . stackFrameWithSymbolFileLine ( item . functionName || '(anonymous)' , item . fileName ?? '' , item . lineNumber ?? - 1 ) ) ;
69
+ const e = FIRExceptionModel . exceptionModelWithNameReason ( error . name || 'JavaScriptError' , error . message ) ;
70
+ e . stackTrace = NSArray . arrayWithArray ( traceElements ) ;
73
71
this . native . recordExceptionModel ( e ) ;
74
72
} ) ;
75
73
} else {
You can’t perform that action at this time.
0 commit comments