Skip to content

Commit

Permalink
fix: Use optional chaining in FirebaseError (#2581)
Browse files Browse the repository at this point in the history
  • Loading branch information
lahirumaramba authored May 29, 2024
1 parent d65e68f commit 2efcec9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ export class FirebaseError extends Error implements FirebaseErrorInterface {

/** @returns The error code. */
public get code(): string {
return this.errorInfo.code;
return this.errorInfo?.code;
}

/** @returns The error message. */
public get message(): string {
return this.errorInfo.message;
return this.errorInfo?.message;
}

/** @returns The object representation of the error. */
Expand Down

0 comments on commit 2efcec9

Please sign in to comment.