Skip to content

Commit fe4e668

Browse files
add optional chaining for http.defaults.host in contentstackClient
1 parent 6e36896 commit fe4e668

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/contentstackClient.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default function contentstackClient ({ http }) {
3131

3232
if (region && region !== Region.NA) {
3333
baseUrlPath = `https://${region}-api.contentstack.com:443/v3/user-session`
34-
} else if (!region && http.defaults.host) {
34+
} else if (!region && http?.defaults?.host) {
3535
baseUrlPath = `https://${http.defaults.host}:443/v3/user-session`
3636
} else {
3737
baseUrlPath = `https://api.contentstack.io:443/v3/user-session`

0 commit comments

Comments
 (0)