From: Giuseppe Bilotta Date: Fri, 3 Jun 2011 12:02:45 +0000 (+0200) Subject: Ruby 1.9 can intern empty strings X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=c5bd13b7ccad6832b75e2a185169d3822c3cc4ef;hp=a7388f8aee855fdb413369bedc0f7a5f46994e48;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git 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. --- 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|