diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2011-06-03 14:02:45 +0200 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2011-06-03 14:02:45 +0200 |
commit | c5bd13b7ccad6832b75e2a185169d3822c3cc4ef (patch) | |
tree | de544f79098cf46f24c0bb51fae2b237ec897f05 /lib | |
parent | a7388f8aee855fdb413369bedc0f7a5f46994e48 (diff) |
Ruby 1.9 can intern empty strings
Since in the subsequent switc we check for nil, explicitly use
nil when the modifier is empty or nil rather than relying on a rescued
exception.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rbot/core/auth.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rbot/core/auth.rb b/lib/rbot/core/auth.rb index c0234d50..ce21ccc9 100644 --- a/lib/rbot/core/auth.rb +++ b/lib/rbot/core/auth.rb @@ -729,7 +729,7 @@ class AuthModule < CoreBotModule buname = params[:name] return m.reply(_("You can't destroy %{user}") % {:user => buname}) if ["everyone", "owner"].include?(buname) - mod = params[:modifier].to_sym rescue nil + mod = params[:modifier].nil_or_empty? ? nil : params[:modifier].to_sym buser_array = @bot.auth.save_array buser_hash = buser_array.inject({}) { |h, u| |