Skip to content

Commit 2efcec9

Browse files
fix: Use optional chaining in FirebaseError (#2581)
1 parent d65e68f commit 2efcec9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/error.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ export class FirebaseError extends Error implements FirebaseErrorInterface {
5454

5555
/** @returns The error code. */
5656
public get code(): string {
57-
return this.errorInfo.code;
57+
return this.errorInfo?.code;
5858
}
5959

6060
/** @returns The error message. */
6161
public get message(): string {
62-
return this.errorInfo.message;
62+
return this.errorInfo?.message;
6363
}
6464

6565
/** @returns The object representation of the error. */

0 commit comments

Comments
 (0)