Skip to content

Commit f666928

Browse files
angelozerrdatho7561
authored andcommitted
Fix crash of extension when proxy settings address has wrong format
Signed-off-by: azerr <[email protected]>
1 parent 0b30585 commit f666928

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/settings/proxySettings.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export function getProxySettings(): ProxySettings {
7575
return null;
7676
}
7777
const regexResult = HOST_AND_PORT_EXTRACTOR.exec(proxyAddress);
78-
if (!regexResult[1]) {
78+
if (!regexResult || !regexResult[1]) {
7979
return null;
8080
}
8181
const host: string = regexResult[1];
@@ -152,7 +152,7 @@ export function jvmArgsContainsProxySettings(jvmArgs: string): boolean {
152152
);
153153
}
154154

155-
const HOST_AND_PORT_EXTRACTOR = /https?:\/\/([^:/]+)(?::([0-9]+))?/;
155+
const HOST_AND_PORT_EXTRACTOR = /(?:https?:\/\/)?([^:/]+)(?::([0-9]+))?/;
156156

157157
const JVM_PROXY_HOST = 'http.proxyHost';
158158
const JVM_PROXY_PORT = 'http.proxyPort';

0 commit comments

Comments
 (0)