From 3ba6b409aa6b7a842207c47ce100f6a46764e34a Mon Sep 17 00:00:00 2001 From: Amaia Castro Date: Tue, 3 Jan 2017 21:41:00 +0100 Subject: [PATCH] Make markdown helper safer to use Avoid exception if text is nil --- app/helpers/application_helper.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 1f52f0eea..313375e3f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -18,6 +18,8 @@ module ApplicationHelper end def markdown(text) + return text if text.blank? + # See https://github.com/vmg/redcarpet for options render_options = { filter_html: false,