Skip to content

Commit c5b8f5c

Browse files
committed
fix: Check for undefined komodo url
1 parent 7baa9c2 commit c5b8f5c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/common/KomodoApi.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,16 @@ export class KomodoApi {
2525
constructor(logger?: Logger, options?: KomodoApiOptions) {
2626
this.logger = childLogger(logger ?? initLogger()[0], 'Komodo API');
2727
this.options = options;
28-
this.urlData = normalizeWebAddress(process.env.KOMODO_URL);
28+
if(process.env.KOMODO_URL !== undefined) {
29+
this.urlData = normalizeWebAddress(process.env.KOMODO_URL);
30+
}
2931
}
3032

3133
init = () => {
3234
if (this.api === undefined) {
35+
if (isUndefinedOrEmptyString(process.env.KOMODO_URL)) {
36+
throw new SimpleError(`Cannot use Komodo API because env KOMODO_URL is missing`);
37+
}
3338
if (isUndefinedOrEmptyString(process.env.API_KEY)) {
3439
throw new SimpleError(`Cannot use Komodo API because env API_KEY is missing`);
3540
}

0 commit comments

Comments
 (0)