diff --git a/app/decorators/commit_decorator.rb b/app/decorators/commit_decorator.rb index f813ed253d74eb000857684f7ca05808d6438879..c85f740027e8c3f973409bd98f700a20e7d6da49 100644 --- a/app/decorators/commit_decorator.rb +++ b/app/decorators/commit_decorator.rb @@ -16,7 +16,7 @@ class CommitDecorator < ApplicationDecorator # In case this first line is longer than 80 characters, it is cut off # after 70 characters and ellipses (`&hellp;`) are appended. def title - return no_commit_message unless safe_message + return no_commit_message if safe_message.blank? title_end = safe_message.index(/\n/) if (!title_end && safe_message.length > 80) || (title_end && title_end > 80) diff --git a/app/helpers/gitlab_markdown_helper.rb b/app/helpers/gitlab_markdown_helper.rb index e97e46f5b66ee17bb079628122a06f844c267114..511d4628e12ab17cdbd026a2e426d63d58f00c67 100644 --- a/app/helpers/gitlab_markdown_helper.rb +++ b/app/helpers/gitlab_markdown_helper.rb @@ -11,6 +11,8 @@ module GitlabMarkdownHelper # explicitly produce the correct linking behavior (i.e. # "outer text gfm ref more outer text"). def link_to_gfm(body, url, html_options = {}) + return "" if body.blank? + gfm_body = gfm(body, html_options) gfm_body.gsub!(%r{.*?}m) do |match|