From 4c767bf58ebe5c224bbf5297b35edfa83b73f46e Mon Sep 17 00:00:00 2001 From: Rick Wargo Date: Fri, 16 Dec 2016 11:38:01 -0500 Subject: [PATCH] Protect against missing ICS properties If the Summary, Location, or Description do not exist, don't try to remove tags. --- src/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/index.js b/src/index.js index 1a76aa8..e266847 100644 --- a/src/index.js +++ b/src/index.js @@ -270,6 +270,8 @@ exports.handler = function (event, context, callback) { // Remove HTML tags from string function removeTags(str) { + if (!str) // some iCal properties may not exist + return str; return str.replace(/<(?:.|\n)*?>/gm, ''); }