From ad7ae52bd9e1fee6c6b01a27bfe29cd4bec28f4c Mon Sep 17 00:00:00 2001 From: Kevin Murphy Date: Mon, 20 Sep 2004 09:11:17 +0000 Subject: [PATCH] Fixed a bug where lookup.search would fail with an error when an invalid domain was provided. --- plugins/Lookup.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/plugins/Lookup.py b/plugins/Lookup.py index f725b08d3..9a95980fd 100644 --- a/plugins/Lookup.py +++ b/plugins/Lookup.py @@ -355,14 +355,19 @@ class Lookup(callbacks.Privmsg): args.remove('--values') (options, rest) = getopt.getopt(args, '', ['regexp=']) (name, globs) = privmsgs.getArgs(rest, optional=1) - try: - results = self.db.searchResults(name, options, globs, column) - except dbi.NoRecordError: - irc.reply('No entries in %s matched that query.' % name) - lookups = ['%s: %s' % (item[0], self._shrink(item[1])) - for item in results] - irc.reply(utils.commaAndify(lookups)) - + if self.db.checkLookup(name): + try: + results = self.db.searchResults(name, options, globs, column) + lookups = ['%s: %s' % (item[0], self._shrink(item[1])) + for item in results] + irc.reply(utils.commaAndify(lookups)) + except dbi.NoRecordError: + irc.reply('No entries in %s matched that query.' % name) + return + else: + irc.reply('I don\'t have a domain %s' % name) + return + def _lookup(self, irc, msg, args): """