diff options
author | http://jneen.net/ <jneen@jneen.net> | 2016-11-16 14:39:07 +0900 |
---|---|---|
committer | http://jneen.net/ <jneen@jneen.net> | 2016-11-17 11:59:44 +0900 |
commit | 4aabf707a94d79f961a0c88f30d77aa7fe49e149 (patch) | |
tree | 3ef14c9a6adaf92eeab773eae30fae57b09482b4 /lib | |
parent | 64e98040a77c05129fd49c01e1466f6027b8bc0e (diff) | |
download | gitlab-ce-4aabf707a94d79f961a0c88f30d77aa7fe49e149.tar.gz |
rename `part` variable and guard against nil content_type
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/email/reply_parser.rb | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/gitlab/email/reply_parser.rb b/lib/gitlab/email/reply_parser.rb index 1ad44425c93..07860c36af8 100644 --- a/lib/gitlab/email/reply_parser.rb +++ b/lib/gitlab/email/reply_parser.rb @@ -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 |