rename part
variable and guard against nil content_type
This commit is contained in:
parent
64e98040a7
commit
4aabf707a9
1 changed files with 5 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue