Fix port log line and add regex check

This commit is contained in:
Alex Ross
2021-04-16 11:24:38 +02:00
parent cfdce94277
commit 5ef190e98a
2 changed files with 7 additions and 2 deletions

View File

@@ -247,7 +247,12 @@ export class PortsAttributes extends Disposable {
const match = (<string>attributesKey).match(PortsAttributes.RANGE);
key = { start: Number(match![1]), end: Number(match![2]) };
} else {
const regTest: RegExp = RegExp(attributesKey);
let regTest: RegExp | undefined = undefined;
try {
regTest = RegExp(attributesKey);
} catch (e) {
// The user entered an invalid regular expression.
}
if (regTest) {
key = regTest;
}