Skip to content

Commit

Permalink
don't fail if the to, from, or cc being matched against isn't an array
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Pokosh committed Feb 9, 2012
1 parent cf43e6f commit 1cf145c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/mailman/route/conditions.rb
Expand Up @@ -5,7 +5,7 @@ class Route
class ToCondition < Condition
def match(message)
if !message.to.nil?
message.to.each do |address|
(message.to.is_a?(Array) ? message.to : [message.to]).each do |address|
if result = @matcher.match(address)
return result
end
Expand All @@ -18,7 +18,7 @@ def match(message)
# Matches against the From addresses of a message.
class FromCondition < Condition
def match(message)
message.from.each do |address|
(message.from.is_a?(Array) ? message.from : [message.from]).each do |address|
if result = @matcher.match(address)
return result
end
Expand Down Expand Up @@ -53,7 +53,7 @@ def match(message)
class CcCondition < Condition
def match(message)
if !message.cc.nil?
message.cc.each do |address|
(message.cc.is_a?(Array) ? message.cc : [message.cc]).each do |address|
if result = @matcher.match(address)
return result
end
Expand Down

0 comments on commit 1cf145c

Please sign in to comment.