Skip to content

Commit

Permalink
Refactor domain checking, rescue from URI errors
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswoodrich committed May 8, 2015
1 parent ce2948a commit ee77f2c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/lita/handlers/google.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ def check_for_excluded_domains(data)
begin
uri = URI.parse(response["unescapedUrl"])
if uri && uri.host
unless config.excluded_domains.any? { |domain| uri.host.include?(domain) }
response
end
response if config.excluded_domains.none? { |domain| uri.host.include?(domain) }
else
response
end
Expand Down

0 comments on commit ee77f2c

Please sign in to comment.