diff --git a/lib/common/utils.js b/lib/common/utils.js index 7665587..2a69999 100644 --- a/lib/common/utils.js +++ b/lib/common/utils.js @@ -181,7 +181,14 @@ function normalizeLink(url) { // Encoder throws exception on broken surrogate pairs. // Fix those first. - return encodeURI(fixBrokenSurrogates(normalized)); + + try { + return encodeURI(fixBrokenSurrogates(normalized)); + } catch (__) { + // This should never happen and left for safety only. + /*istanbul ignore next*/ + return ''; + } } ////////////////////////////////////////////////////////////////////////////////