Skip to content

Commit 93aec16

Browse files
committed
fix undefined bug
1 parent 10696da commit 93aec16

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

apps/web/utils/gmail/forward.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ ${message.textPlain}`;
4545
};
4646

4747
const formatFromEmailWithName = (emailHeader: string) => {
48-
const match = emailHeader.match(/(.*?)\s*<([^>]+)>/);
49-
if (!match) return emailHeader;
48+
const match = emailHeader?.match(/(.*?)\s*<([^>]+)>/);
49+
if (!match) return emailHeader || "";
5050

5151
const [, name, email] = match;
5252
const trimmedName = name.trim();
@@ -55,8 +55,8 @@ const formatFromEmailWithName = (emailHeader: string) => {
5555
};
5656

5757
const formatToEmailWithName = (emailHeader: string) => {
58-
const match = emailHeader.match(/(.*?)\s*<([^>]+)>/);
59-
if (!match) return emailHeader;
58+
const match = emailHeader?.match(/(.*?)\s*<([^>]+)>/);
59+
if (!match) return emailHeader || "";
6060

6161
const [, name, email] = match;
6262
const trimmedName = name.trim();

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1.3.14
1+
v1.3.15

0 commit comments

Comments
 (0)