Skip to content

Commit fbc09d1

Browse files
committed
fix: apiURL is optional
1 parent 94c2858 commit fbc09d1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/clients/src/scw/client-settings.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@ export const assertValidSettings = (obj: Readonly<Settings>): void => {
112112
}
113113

114114
// API URL.
115-
if (!isURL(obj.apiURL)) {
115+
if (obj.apiURL && !isURL(obj.apiURL)) {
116116
throw new Error(`Invalid URL ${obj.apiURL}`)
117117
}
118118

119-
if (obj.apiURL.endsWith('/')) {
119+
if (obj.apiURL?.endsWith('/')) {
120120
throw new Error(
121121
`Invalid URL ${obj.apiURL}: it should not have a trailing slash`,
122122
)

0 commit comments

Comments
 (0)