Parcourir la source

replace text only when text is valid

cc @arturi
Ifedapo Olarewaju il y a 6 ans
Parent
commit
985fd62ed6
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      packages/@uppy/companion/src/server/helpers/utils.js

+ 1 - 1
packages/@uppy/companion/src/server/helpers/utils.js

@@ -38,7 +38,7 @@ exports.jsonStringify = (data) => {
  * @param {string} text
  * @param {string} text
  */
  */
 exports.sanitizeHtml = (text) => {
 exports.sanitizeHtml = (text) => {
-  return text.replace(/<\/?[^>]+(>|$)/g, '')
+  return text ? text.replace(/<\/?[^>]+(>|$)/g, '') : text
 }
 }
 
 
 /**
 /**