Improved error handling.

This commit is contained in:
Martin Edenhofer 2012-10-18 13:41:47 +02:00
parent 5bf96897e2
commit dd7ed8a7ba

View file

@ -12,7 +12,10 @@ module Channel::Filter::Database
filter[:match].each {|key, value|
loop = true
begin
scan = mail[ key.downcase.to_sym ].scan(/#{value}/i)
scan = []
if mail
scan = mail[ key.downcase.to_sym ].scan(/#{value}/i)
end
if match && scan[0]
puts " matching #{ key.downcase }:'#{ mail[ key.downcase.to_sym ] }' on #{value}"
match = true