diff --git a/lib/internal/policy/sri.js b/lib/internal/policy/sri.js index 6728ff4de22bd1..22704704a310bc 100644 --- a/lib/internal/policy/sri.js +++ b/lib/internal/policy/sri.js @@ -38,7 +38,7 @@ const parse = (str) => { let prevIndex = 0; let match; const entries = []; - while (match = RegExpPrototypeExec(kSRIPattern, str)) { + while ((match = RegExpPrototypeExec(kSRIPattern, str)) !== null) { if (match.index !== prevIndex) { throw new ERR_SRI_PARSE(str, str[prevIndex], prevIndex); }