Commit 4aabf707 authored by http://jneen.net/'s avatar http://jneen.net/

rename `part` variable and guard against nil content_type

parent 64e98040
......@@ -23,15 +23,13 @@ module Gitlab
private
def select_body(message)
if message.multipart?
text = message.text_part || message.html_part || message
part = if message.multipart?
message.text_part || message.html_part || message
else
text = message
message
end
return "" unless text
decoded = fix_charset(text)
decoded = fix_charset(part)
return "" unless decoded
......@@ -40,7 +38,7 @@ module Gitlab
return ""
end
if text.content_type =~ %r(text/html)
if (part.content_type || '').include? 'text/html'
HTMLParser.parse_reply(decoded)
else
decoded
......
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