From 21100a0a8b5e2db75c40c001d049ba3787f75192 Mon Sep 17 00:00:00 2001 From: Kyle Shockey Date: Thu, 22 Jun 2017 22:05:38 -0700 Subject: [PATCH] Don't render Markdown if input or sanitized input is empty --- src/core/components/providers/markdown.jsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/components/providers/markdown.jsx b/src/core/components/providers/markdown.jsx index d058d176..8ebce12c 100644 --- a/src/core/components/providers/markdown.jsx +++ b/src/core/components/providers/markdown.jsx @@ -11,6 +11,12 @@ const sanitizeOptions = { function Markdown({ source }) { const sanitized = sanitize(source, sanitizeOptions) + + // sometimes the sanitizer returns "undefined" as a string + if(!source || !sanitized || sanitized === "undefined") { + return null + } + return