Browse Source

replace text only when text is valid

cc @arturi
Ifedapo Olarewaju 6 years ago
parent
commit
985fd62ed6
1 changed files with 1 additions and 1 deletions
  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
 }
 
 /**