Skip to content

Commit 8fe4465

Browse files
Only return debugInfo if url is passed (#3103)
1 parent 608737f commit 8fe4465

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

lib/services/debug-service.ts

+14-5
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,22 @@ export class DebugService extends EventEmitter implements IDebugService {
9595
}
9696

9797
private getDebugInformation(fullUrl: string): IDebugInformation {
98-
const parseQueryString = true;
99-
const wsQueryParam = parse(fullUrl, parseQueryString).query.ws;
100-
const hostPortSplit = wsQueryParam && wsQueryParam.split(":");
101-
return {
98+
let debugInfo: IDebugInformation = {
10299
url: fullUrl,
103-
port: hostPortSplit && +hostPortSplit[1]
100+
port: 0
104101
};
102+
103+
if (fullUrl) {
104+
const parseQueryString = true;
105+
const wsQueryParam = parse(fullUrl, parseQueryString).query.ws;
106+
const hostPortSplit = wsQueryParam && wsQueryParam.split(":");
107+
debugInfo = {
108+
url: fullUrl,
109+
port: hostPortSplit && +hostPortSplit[1]
110+
};
111+
}
112+
113+
return debugInfo;
105114
}
106115
}
107116

0 commit comments

Comments
 (0)