diff --git a/src/vapid-helper.js b/src/vapid-helper.js index 343d11e8..c0305bdd 100644 --- a/src/vapid-helper.js +++ b/src/vapid-helper.js @@ -75,8 +75,9 @@ function validateSubject(subject) { + 'mailto: address. ' + subject); } + let subjectParseResult = null; try { - const subjectParseResult = new URL(subject); + subjectParseResult = new URL(subject); } catch (err) { throw new Error('Vapid subject is not a valid URL. ' + subject); }