lib/mail/header.rb in mail-2.2.7 vs lib/mail/header.rb in mail-2.2.9
- old
+ new
@@ -159,19 +159,21 @@
self.fields << Field.new(name.to_s, value, charset)
end
end
def charset
- if self[:content_type] && self[:content_type].parameters
- self[:content_type].parameters[:charset]
+ params = self[:content_type].parameters rescue nil
+ if params
+ params[:charset]
else
@charset
end
end
def charset=(val)
- if self[:content_type]
- self[:content_type].parameters[:charset] = val
+ params = self[:content_type].parameters rescue nil
+ if params
+ params[:charset] = val
end
@charset = val
end
LIMITED_FIELDS = %w[ date from sender reply-to to cc bcc