Browse Source

Added one more try/catch wrapper to normalizer, for safety

pull/41/head
Vitaly Puzrin 10 years ago
parent
commit
da0e9c78a5
  1. 9
      lib/common/utils.js

9
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 '';
}
}
////////////////////////////////////////////////////////////////////////////////

Loading…
Cancel
Save