Skip to content

Commit

Permalink
fix(app): convert NativeFirebaseError.getStackWithMessage to static t…
Browse files Browse the repository at this point in the history
…o fix crash (invertase#4619)

* change instance method to static method to avoid fatal error while parsing error
* http error
* lint errors

Co-authored-by: blashadow <blackzerogamer@gmail.com>
  • Loading branch information
mikehardy and BlaShadow authored Nov 26, 2020
1 parent d3fbfa2 commit f9124fa
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/internal/NativeFirebaseError.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ export default class NativeFirebaseError extends Error {
value: userInfo.nativeErrorMessage || null,
});

this.stack = this.getStackWithMessage(`NativeFirebaseError: ${this.message}`);
this.stack = NativeFirebaseError.getStackWithMessage(
`NativeFirebaseError: ${this.message}`,
this.jsStack,
);

// Unused
// this.nativeStackIOS = nativeError.nativeStackIOS;
Expand All @@ -71,7 +74,7 @@ export default class NativeFirebaseError extends Error {
*
* @returns {string}
*/
getStackWithMessage(message) {
return [message, ...this.jsStack.split('\n').slice(2, 13)].join('\n');
static getStackWithMessage(message, jsStack) {
return [message, ...jsStack.split('\n').slice(2, 13)].join('\n');
}
}

0 comments on commit f9124fa

Please sign in to comment.