From c5bd13b7ccad6832b75e2a185169d3822c3cc4ef Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Fri, 3 Jun 2011 14:02:45 +0200 Subject: [PATCH] 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. --- lib/rbot/core/auth.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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| -- 2.39.2