diff --git a/lib/services/debug-service.ts b/lib/services/debug-service.ts index a276e484d4..a55cfb17c0 100644 --- a/lib/services/debug-service.ts +++ b/lib/services/debug-service.ts @@ -95,13 +95,22 @@ export class DebugService extends EventEmitter implements IDebugService { } private getDebugInformation(fullUrl: string): IDebugInformation { - const parseQueryString = true; - const wsQueryParam = parse(fullUrl, parseQueryString).query.ws; - const hostPortSplit = wsQueryParam && wsQueryParam.split(":"); - return { + let debugInfo: IDebugInformation = { url: fullUrl, - port: hostPortSplit && +hostPortSplit[1] + port: 0 }; + + if (fullUrl) { + const parseQueryString = true; + const wsQueryParam = parse(fullUrl, parseQueryString).query.ws; + const hostPortSplit = wsQueryParam && wsQueryParam.split(":"); + debugInfo = { + url: fullUrl, + port: hostPortSplit && +hostPortSplit[1] + }; + } + + return debugInfo; } }