diff --git a/plugins/User/plugin.py b/plugins/User/plugin.py index 65b37197c..3f8c765a6 100644 --- a/plugins/User/plugin.py +++ b/plugins/User/plugin.py @@ -176,9 +176,12 @@ class User(callbacks.Plugin): user (and the user whose password is being changed isn't that same owner user), then needn't be correct. """ - u = ircdb.users.getUser(msg.prefix) + try: + u = ircdb.users.getUser(msg.prefix) + except KeyError: + u = None if user.checkPassword(password) or \ - (u._checkCapability('owner') and not u == user): + (u and u._checkCapability('owner') and not u == user): user.setPassword(newpassword) ircdb.users.setUser(user) irc.replySuccess()