Commit 1c780792 authored by Airat Shigapov's avatar Airat Shigapov Committed by blackst0ne

Use guard clause instead of if-else statement

parent f6a97e6c
...@@ -128,7 +128,8 @@ class HipchatService < Service ...@@ -128,7 +128,8 @@ class HipchatService < Service
end end
def markdown(text, options = {}) def markdown(text, options = {})
if text return "" unless text
context = { context = {
project: project, project: project,
pipeline: :email pipeline: :email
...@@ -140,10 +141,8 @@ class HipchatService < Service ...@@ -140,10 +141,8 @@ class HipchatService < Service
html = Banzai.render(text, context) html = Banzai.render(text, context)
html = Banzai.post_process(html, context) html = Banzai.post_process(html, context)
sanitize html, attributes: %w(href title alt) sanitize html, attributes: %w(href title alt)
else
""
end
end end
def create_issue_message(data) def create_issue_message(data)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment