summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/rbot/core/auth.rb10
1 files changed, 6 insertions, 4 deletions
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]