From 07535ad7bae230679ef2b979570bc294515be9cf Mon Sep 17 00:00:00 2001 From: Lahiru Maramba Date: Tue, 28 May 2024 15:35:13 -0400 Subject: [PATCH] fix: Use optional chaining in FirebaseError --- src/utils/error.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/error.ts b/src/utils/error.ts index 772d808a9a..ef56431a03 100644 --- a/src/utils/error.ts +++ b/src/utils/error.ts @@ -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. */