Ver Fonte

replace text only when text is valid

cc @arturi
Ifedapo Olarewaju há 6 anos atrás
pai
commit
985fd62ed6
1 ficheiros alterados com 1 adições e 1 exclusões
  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
  */
 exports.sanitizeHtml = (text) => {
-  return text.replace(/<\/?[^>]+(>|$)/g, '')
+  return text ? text.replace(/<\/?[^>]+(>|$)/g, '') : text
 }
 
 /**