Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

auto_redirect must not crash if there's no redirection info and :excl…

…ude is given.
  • Loading branch information...
commit 7aae8724922c527e3b0b676d5c359a942e9bd30e 1 parent 2184dcf
@FooBarWidget authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/auto_redirection/controller_extensions.rb
View
7 lib/auto_redirection/controller_extensions.rb
@@ -109,11 +109,14 @@ def attempt_auto_redirect
# is supposed to be redirected to matches this regular expression, then
# the browser will be redirected to the default location instead.
def auto_redirect(options = {})
+ # TODO: document that :exclude may also be a Hash, Array or String.
should_redirect_to_default = false
if options[:exclude]
info = get_redirection_information
- should_redirect_to_default = match_exclusion_list(info,
- options[:exclude])
+ if info
+ should_redirect_to_default = match_exclusion_list(info,
+ options[:exclude])
+ end
end
if !should_redirect_to_default
should_redirect_to_default = !attempt_auto_redirect
Please sign in to comment.
Something went wrong with that request. Please try again.