From 5241be5d7aad06247f0e101a153a279b0bb11aa8 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Fri, 21 Sep 2007 15:35:13 +0000 Subject: New Auth Framework: auth core botmodule was failing when someone asked something about a nonexisting botuser --- lib/rbot/core/auth.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/rbot/core/auth.rb b/lib/rbot/core/auth.rb index 59bcd54a..f32dad1c 100644 --- a/lib/rbot/core/auth.rb +++ b/lib/rbot/core/auth.rb @@ -343,10 +343,12 @@ class AuthModule < CoreBotModule butarget = botuser has_for = splits[-2] == "for" - butarget = @bot.auth.get_botuser(splits[-1]) if has_for - return m.reply(_("you can't mess with %{user}") % {:user => butarget.username}) \ - if butarget == @bot.auth.botowner && botuser != butarget - splits.slice!(-2,2) if has_for + if has_for + butarget = @bot.auth.get_botuser(splits[-1]) rescue nil + return m.reply(_("no such bot user %{user}") % {:user => splits[-1]}) unless butarget + splits.slice!(-2,2) + end + return m.reply(_("you can't mess with %{user}") % {:user => butarget.username}) if butarget == @bot.auth.botowner && botuser != butarget bools = [:autologin, :"login-by-mask"] can_set = [:password] -- cgit v1.2.3