Skip to content

Commit cfd481f

Browse files
Update forceBrazeMessage.ts
1 parent d25e95f commit cfd481f

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

dotcom-rendering/src/lib/braze/forceBrazeMessage.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
const runtimeHostname = () => {
2-
try {
3-
if (typeof process !== 'undefined' && process.env.HOSTNAME) {
4-
return process.env.HOSTNAME;
5-
}
6-
} catch {
7-
/* ignore */
1+
const runtimeHostname = (): string | undefined => {
2+
if (typeof process !== 'undefined' && process.env.HOSTNAME) {
3+
return process.env.HOSTNAME;
84
}
95
if (typeof window !== 'undefined' && window.location.hostname) {
106
return window.location.hostname;
117
}
8+
return undefined;
129
};
1310

1411
const FORCE_BRAZE_ALLOWLIST = [

0 commit comments

Comments
 (0)