From a9afa24428444b70c2ebdf693a3aa9e4a9318135 Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 2 Mar 2017 11:38:20 +0100 Subject: [PATCH] return empty string instead of blowing up when fixing HTML --- www/common/cryptpad-common.js | 1 + 1 file changed, 1 insertion(+) diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 80b366766..907d9f612 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -164,6 +164,7 @@ define([ var isArray = common.isArray = $.isArray; var fixHTML = common.fixHTML = function (str) { + if (!str) { return ''; } return str.replace(/[<>&"']/g, function (x) { return ({ "<": "<", ">": ">", "&": "&", '"': """, "'": "'" })[x]; });