Services: Fix crash in __call__

When a password is added for a nick that is not a valid config entry name,
this causes _getNickServPassword to raise an error; and __call__ needs
to catch it or the bot becomes unusable.
This commit is contained in:
Valentin Lorentz 2024-07-11 16:57:01 +02:00
parent 01cdfee53e
commit b3f256681f

View File

@ -179,7 +179,11 @@ class Services(callbacks.Plugin):
if nick not in self.registryValue('nicks', network=irc.network):
return
nickserv = self.registryValue('NickServ', network=irc.network)
password = self._getNickServPassword(nick, irc.network)
try:
password = self._getNickServPassword(nick, irc.network)
except Exception:
self.log.exception('Could not get NickServ password for %s', nick)
return
ghostDelay = self.registryValue('ghostDelay', network=irc.network)
if not ghostDelay:
return